From ace8200df0be4d9dd48dab1ac5b3d89c4e964f37 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sun, 2 Feb 2025 20:37:11 +0100 Subject: [PATCH] chore: CI/CD --- .forgejo/workflows/release.yaml | 54 +++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .forgejo/workflows/release.yaml diff --git a/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml new file mode 100644 index 0000000..dfa0268 --- /dev/null +++ b/.forgejo/workflows/release.yaml @@ -0,0 +1,54 @@ +name: Build and push Docker image to Container Registry + +on: + push: + branches: + - main + tags: + - '*' + +jobs: + build-and-push: + name: Build and push Docker image to Container Registry + runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:act-latest + env: + DOCKER_LATEST: latest + RUNNER_TOOL_CACHE: /toolcache + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Container Registry + uses: docker/login-action@v2 + with: + registry: git.depeuter.dev + username: ${{ gitea.actor }} + password: ${{ secrets.CI_TOKEN }} + + - name: Get Meta + id: meta + uses: docker/metadata-action@v5 + with: + images: git.depeuter.dev/${{ gitea.repository }} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v5 + with: + context: . + file: ./frontend/Dockerfile + push: true + tags: ${{ steps.meta.output.tags }} + label: ${{ steps.meta.output.labels }} + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} \ No newline at end of file