From 5c07f2bbb02adf9a47312a42dc74455ed448d628 Mon Sep 17 00:00:00 2001 From: vitor Date: Fri, 1 Dec 2023 18:10:44 -0300 Subject: [PATCH] update cicd ci_tests.yml --- .github/workflows/build_deploy_v0.1.yml | 24 +++++++++++++++--------- .github/workflows/ci_tests.yml | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_deploy_v0.1.yml b/.github/workflows/build_deploy_v0.1.yml index 8d1ee6a..f0bf3e5 100644 --- a/.github/workflows/build_deploy_v0.1.yml +++ b/.github/workflows/build_deploy_v0.1.yml @@ -21,9 +21,9 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - - name: Log into registry + - name: Log into registry ${{ env.REGISTRY }} if: github.event_name != 'pull_request' - uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c + uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -33,14 +33,20 @@ jobs: shell: bash run: echo "TAG_NAME=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV - - name: Build and push Docker image tag - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - with: - push: true - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG_NAME }} + - name: Build and push Docker dev image + run: | + docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-dev -f Dockerfile.dev . + docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-dev + if: github.event_name == 'push' - name: Build and push Docker image latest - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + uses: docker/build-push-action@v3 with: push: true - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \ No newline at end of file + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + + - name: Push Docker image Tag + run: | + docker tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG_NAME }} + docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG_NAME }} + if: github.event_name == 'push' diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 91ea934..f39d5cb 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -14,8 +14,8 @@ jobs: name: build and test runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2 - name: Set up environment variables for testing - uses: actions/checkout@v2 run: make init-env - name: Run all service containers run: make up