Files
fingerprint-chromium/.gitea/workflows/publish.yml
T
rogeeandmultica-agent 365c4183fa
Build and publish image / image (pull_request) Successful in 2m54s
fix: link Gitea package to repository
Co-authored-by: multica-agent <github@multica.ai>
2026-08-26 17:15:47 +08:00

44 lines
1.6 KiB
YAML

name: Build and publish image
on:
pull_request:
push:
branches: [main]
schedule:
- cron: "17 3 * * *"
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check scripts
run: ./tests/check.sh
- name: Log in to Gitea registry
if: gitea.event_name != 'pull_request'
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.ipao.vip --username "${{ gitea.actor }}" --password-stdin
- name: Build image
env:
OCI_REVISION: ${{ gitea.sha }}
OCI_SOURCE: https://git.ipao.vip/rogee/fingerprint-chromium
PUSH: ${{ gitea.event_name != 'pull_request' }}
run: ./scripts/build.sh git.ipao.vip/rogee/fingerprint-chromium
- name: Link package to repository
if: gitea.event_name != 'pull_request'
env:
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
package_api=https://git.ipao.vip/api/v1/packages/rogee/container/fingerprint-chromium
linked_repo="$(curl --fail --silent --show-error "$package_api/-/latest" | jq -r '.repository.full_name // empty')"
if [ "$linked_repo" != rogee/fingerprint-chromium ]; then
curl --fail --silent --show-error --request POST \
--header "Authorization: token $REGISTRY_TOKEN" \
"$package_api/-/link/fingerprint-chromium"
fi
test "$(curl --fail --silent --show-error "$package_api/-/latest" | jq -r '.repository.full_name // empty')" = rogee/fingerprint-chromium