From ed957aae975cd76f5baddf03c94d485980fdb63f Mon Sep 17 00:00:00 2001 From: myrmidex Date: Thu, 19 Mar 2026 01:07:42 +0100 Subject: [PATCH] Add Forgejo build workflow for Docker image push --- .forgejo/workflows/build.yml | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .forgejo/workflows/build.yml diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml new file mode 100644 index 0000000..0596200 --- /dev/null +++ b/.forgejo/workflows/build.yml @@ -0,0 +1,41 @@ +name: Build and Push Docker Image +on: + push: + branches: [main] + tags: ['v*'] + +jobs: + build: + runs-on: docker + container: + image: catthehacker/ubuntu:act-latest + steps: + - uses: https://data.forgejo.org/actions/checkout@v4 + + - name: Set up Docker Buildx + uses: https://data.forgejo.org/docker/setup-buildx-action@v3 + + - name: Login to Forgejo Registry + uses: https://data.forgejo.org/docker/login-action@v3 + with: + registry: forge.lvl0.xyz + username: ${{ github.actor }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Determine tags + id: meta + run: | + if [[ "${{ github.ref }}" == refs/tags/v* ]]; then + TAG="${{ github.ref_name }}" + echo "tags=forge.lvl0.xyz/lvl0/buckets:${TAG},forge.lvl0.xyz/lvl0/buckets:latest" >> $GITHUB_OUTPUT + else + echo "tags=forge.lvl0.xyz/lvl0/buckets:latest" >> $GITHUB_OUTPUT + fi + + - name: Build and push + uses: https://data.forgejo.org/docker/build-push-action@v5 + with: + context: . + file: Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }}