From 54a635bbdb749972b0b67fc7cc04dae6e7b1e3b6 Mon Sep 17 00:00:00 2001 From: Konst Date: Thu, 13 Jun 2024 17:03:14 +0300 Subject: [PATCH 1/3] Build action --- .github/workflows/build.yml | 57 ++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3686754..b9bbdea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,22 +1,51 @@ name: Build - on: - pull_request: push: branches: - - main + - 'master' + tags: + - 'v*.*.*' + pull_request: + branches: + - 'master' jobs: - build-cardinal: - name: Cardinal + build: + name: Build runs-on: ubuntu-latest - defaults: - run: - working-directory: ./cardinal + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + DOCKER_REGISTRY: ghcr.io + DOCKER_IMAGE_NAME: ${{ github.repository }} steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Docker Build - uses: docker/setup-buildx-action@v2 - - name: Build Cardinal Docker Image - run: docker build . + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Log in to the registry + uses: docker/login-action@v1 + with: + registry: ${{ env.DOCKER_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Cardinal + + - name: Cardinal image tags & labels + id: meta-cardinal + uses: docker/metadata-action@v3 + with: + images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}-cardinal + + - name: Cardinal image build & push + uses: docker/build-push-action@v2 + with: + context: ./cardinal + file: Dockerfile + push: true + cache-from: type=gha + cache-to: type=gha,mode=max + tags: ${{ steps.meta-cardinal.outputs.tags }} + labels: ${{ steps.meta-cardinal.outputs.labels }} From d7f49bddd9a31503caf956bedae685c29f32df8f Mon Sep 17 00:00:00 2001 From: Konst Date: Thu, 13 Jun 2024 17:07:45 +0300 Subject: [PATCH 2/3] Updated Dockerfile path --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b9bbdea..21d17a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,7 @@ jobs: uses: docker/build-push-action@v2 with: context: ./cardinal - file: Dockerfile + file: ./Dockerfile push: true cache-from: type=gha cache-to: type=gha,mode=max From 9c54e2029550f413d6696b802378525806c9211f Mon Sep 17 00:00:00 2001 From: Konst Date: Thu, 13 Jun 2024 17:08:50 +0300 Subject: [PATCH 3/3] Removed Dockerfile path --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 21d17a5..0b67968 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,6 @@ jobs: uses: docker/build-push-action@v2 with: context: ./cardinal - file: ./Dockerfile push: true cache-from: type=gha cache-to: type=gha,mode=max