Skip to content

Commit

Permalink
update cicd ci_tests.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
vitor authored and vitor committed Dec 1, 2023
1 parent 8332437 commit 5c07f2b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/build_deploy_v0.1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
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'
2 changes: 1 addition & 1 deletion .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5c07f2b

Please sign in to comment.