From 4849288a06fc4fed82e748105cb9135a25ea3036 Mon Sep 17 00:00:00 2001 From: Alie Date: Fri, 3 Jan 2025 11:01:57 +0100 Subject: [PATCH] add build workflow --- .gitea/workflows/02_build.yaml | 52 ++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .gitea/workflows/02_build.yaml diff --git a/.gitea/workflows/02_build.yaml b/.gitea/workflows/02_build.yaml new file mode 100644 index 0000000..1f7b58f --- /dev/null +++ b/.gitea/workflows/02_build.yaml @@ -0,0 +1,52 @@ +name: Build image +on: + pull_request: + paths: + - .gitea/workflows/02_build.yaml + push: + tags: + - v* + +jobs: + build: + container: + image: docker:dind + volumes: + - /data/.cache/act:/data/.cache/act + - /var/lib/docker/image:/var/lib/docker/image + - /var/lib/docker/overlay2:/var/lib/docker/overlay2 + steps: + - name: Starting docker daemon + run: docker-init -- dockerd --host=unix:///var/run/docker.sock & + - name: Installing necessary packages + run: apk add nodejs git curl bash + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - name: Docker meta + id: meta + uses: https://github.com/docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5 + with: + # list of Docker images to use as base name for tags + images: | + git.fai.st/fedi-image-bot/moderation-fe + # generate Docker tags based on the following events/attributes + tags: | + type=raw,value=latest + type=ref,event=branch + type=semver,pattern={{raw}} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2 + - name: Login to fai.st docker registry + uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3 + with: + registry: git.fai.st + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASS }} + - name: Build and push + uses: docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9 # v4 + with: + platforms: linux/amd64,linux/arm64 + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}