From 885442efceaddb0e97e87c7ed99947be80516d16 Mon Sep 17 00:00:00 2001 From: pfych Date: Sun, 20 Apr 2025 14:01:55 +1000 Subject: [PATCH] Build image in action --- .gitea/workflows/build-container.yml | 41 ++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .gitea/workflows/build-container.yml diff --git a/.gitea/workflows/build-container.yml b/.gitea/workflows/build-container.yml new file mode 100644 index 0000000..b258c41 --- /dev/null +++ b/.gitea/workflows/build-container.yml @@ -0,0 +1,41 @@ +name: Build and Push Container +on: + push: + branches: [ main ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: git.pfy.ch/pfych/chapter-tracker + # generate Docker tags based on the following events/attributes + tags: | + type=ref,event=tag + type=ref,event=branch + type=sha + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Registry + uses: docker/login-action@v3 + with: + registry: git.pfy.ch + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}