Files
ForgejoReleaseSync/.gitea/workflows/run-forgejo-release-sync.yml
T
2026-11-04 17:50:37 +03:30

55 lines
1.6 KiB
YAML

name: Run Forgejo Release Sync
on:
schedule:
- cron: '0 0 * * *' # daily at 00:00 UTC
push:
branches:
- master
workflow_dispatch:
jobs:
sync:
runs-on: tsv-s1
container:
image: hub.hamdocker.ir/docker:dind
privileged: true
steps:
- name: Switch Alpine to MobinHost mirror
run: |
ALPINE_VERSION=$(cat /etc/alpine-release | cut -d. -f1,2)
echo "https://mirror.mobinhost.com/alpine/v${ALPINE_VERSION}/main" > /etc/apk/repositories
echo "https://mirror.mobinhost.com/alpine/v${ALPINE_VERSION}/community" >> /etc/apk/repositories
- name: Install required tools
run: apk add --no-cache git nodejs
- uses: actions/checkout@v7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
with:
buildkitd-config-inline: |
[registry."docker.io"]
mirrors = ["https://hub.hamdocker.ir"]
- name: Build image
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile
push: false
load: true
tags: forgejo-release-sync:latest
- name: Run sync
run: |
docker run --rm \
-e FORGEJO_INSTANCE="${{ secrets.FORGEJO_INSTANCE }}" \
-e FORGEJO_TOKEN="${{ secrets.FORGEJO_TOKEN }}" \
-e SYNC_CONCURRENCY="${{ vars.SYNC_CONCURRENCY || '3' }}" \
-e REPO_CONFIG_FILE="/config/config.toml" \
-v "${{ github.workspace }}/config.toml:/config/config.toml:ro" \
forgejo-release-sync:latest