From 8bc697a7f4ca47b4ee9ccbbbb094e1764393088a Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sun, 22 Mar 2026 17:40:02 +0000 Subject: [PATCH] Migrate to forgejo --- .forgejo/workflows/docker-publish.yml | 58 +++++++++++++++++++++++++++ .forgejo/workflows/shellcheck.yml | 19 +++++++++ 2 files changed, 77 insertions(+) create mode 100644 .forgejo/workflows/docker-publish.yml create mode 100644 .forgejo/workflows/shellcheck.yml diff --git a/.forgejo/workflows/docker-publish.yml b/.forgejo/workflows/docker-publish.yml new file mode 100644 index 0000000..4d2b812 --- /dev/null +++ b/.forgejo/workflows/docker-publish.yml @@ -0,0 +1,58 @@ +name: Docker + +on: + push: + branches: [ "main" ] + # Publish semver tags as releases. + tags: [ 'v*.*.*' ] + pull_request: + branches: [ "main" ] + +env: + REGISTRY: ${{ forgejo.server_url }} + IMAGE_NAME: ${{ forgejo.repository }} + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: https://code.forgejo.org/actions/checkout@v4 + + # Set up BuildKit Docker container builder to be able to build + # multi-platform images and export cache + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + uses: https://github.com/docker/setup-buildx-action@v3 + + # Login against the Forgejo container registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: forgejo.event_name != 'pull_request' + uses: https://github.com/docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ forgejo.actor }} + password: ${{ secrets.FORGEJO_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: https://github.com/docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: https://github.com/docker/build-push-action@v5 + with: + context: . + push: ${{ forgejo.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + diff --git a/.forgejo/workflows/shellcheck.yml b/.forgejo/workflows/shellcheck.yml new file mode 100644 index 0000000..196a617 --- /dev/null +++ b/.forgejo/workflows/shellcheck.yml @@ -0,0 +1,19 @@ +name: ShellCheck + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + shellcheck: + runs-on: ubuntu-latest + steps: + - uses: https://code.forgejo.org/actions/checkout@v4 + + - name: Install ShellCheck + run: apt-get update && apt-get install -y shellcheck + + - name: Run ShellCheck + run: find ./src -name '*.sh' -exec shellcheck {} +