From bdbab07f16ab0616eaeb6c5b1e1a533e1fae332d Mon Sep 17 00:00:00 2001 From: Bhasher Date: Tue, 9 Jan 2024 23:48:31 +0100 Subject: [PATCH] CI on tag --- .gitea/workflows/backend.yaml | 49 ++++++++++++++++++++++++++++++++++ .gitea/workflows/frontend.yaml | 13 +++++++-- 2 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 .gitea/workflows/backend.yaml diff --git a/.gitea/workflows/backend.yaml b/.gitea/workflows/backend.yaml new file mode 100644 index 0000000..4e20223 --- /dev/null +++ b/.gitea/workflows/backend.yaml @@ -0,0 +1,49 @@ +name: Backend docker image +run-name: ${{ gitea.actor }} is runs ci pipeline +on: + push: + tags: + - "v*" + +jobs: + release-image: + runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:act-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Extract tag + uses: olegtarasov/get-tag@v2.1.2 + id: tagName + with: + tagRegex: "v(.*)" + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + config-inline: | + [registry."git.bhasher.com"] + http = true + insecure = true + + - name: Login + uses: docker/login-action@v2 + with: + registry: git.bhasher.com + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push frontend + uses: docker/build-push-action@v5 + with: + context: ./backend + file: ./backend/Dockerfile + push: true + platforms: | + linux/amd64 + linux/arm64 + tags: | + git.bhasher.com/bhasher/focus-backend:latest + git.bhasher.com/bhasher/focus-backend:${{ steps.tagName.outputs.tag }} diff --git a/.gitea/workflows/frontend.yaml b/.gitea/workflows/frontend.yaml index a07c7c5..ed3c6a9 100644 --- a/.gitea/workflows/frontend.yaml +++ b/.gitea/workflows/frontend.yaml @@ -1,7 +1,9 @@ -name: Build And Push +name: Frontend docker image run-name: ${{ gitea.actor }} is runs ci pipeline on: - - push + push: + tags: + - "v*" jobs: release-image: @@ -12,6 +14,12 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Extract tag + uses: olegtarasov/get-tag@v2.1.2 + id: tagName + with: + tagRegex: "v(.*)" + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 with: @@ -38,3 +46,4 @@ jobs: linux/arm64 tags: | git.bhasher.com/bhasher/focus-frontend:latest + git.bhasher.com/bhasher/focus-frontend:${{ steps.tagName.outputs.tag }}