From 8d8ac712b48887f9f9fddf04886ee3c020a236d5 Mon Sep 17 00:00:00 2001 From: Loudbook Date: Tue, 10 Dec 2024 17:10:01 -0500 Subject: [PATCH 1/2] Update build-and-deploy.yml --- .github/workflows/build-and-deploy.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 971daa2..95f415d 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -2,9 +2,9 @@ name: Build and Publish Docker Images on: push: - paths: - - frontend/** - - backend/** + # paths: + # - frontend/** + # - backend/** branches: - master - dev @@ -45,7 +45,13 @@ jobs: exit 1 fi echo "branch_tag=${{ env.tag }}" >> $GITHUB_ENV - + + - name: Debug Branch and Tags + run: | + echo "Branch name: ${{ github.ref_name }}" + echo "Tag: ${{ env.tag }}" + echo "Branch tag: ${{ env.branch_tag }}" + - name: Build and push frontend Docker image to GHCR uses: docker/build-push-action@v3 with: From 5c2973844311656178815b039702f02ad1505bca Mon Sep 17 00:00:00 2001 From: Loudbook Date: Tue, 10 Dec 2024 17:11:15 -0500 Subject: [PATCH 2/2] Update build-and-deploy.yml --- .github/workflows/build-and-deploy.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 95f415d..581a98c 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -44,13 +44,6 @@ jobs: echo "Unknown branch: ${{ github.ref_name }}" exit 1 fi - echo "branch_tag=${{ env.tag }}" >> $GITHUB_ENV - - - name: Debug Branch and Tags - run: | - echo "Branch name: ${{ github.ref_name }}" - echo "Tag: ${{ env.tag }}" - echo "Branch tag: ${{ env.branch_tag }}" - name: Build and push frontend Docker image to GHCR uses: docker/build-push-action@v3 @@ -61,7 +54,7 @@ jobs: COMMIT_HASH=${{ env.hash }} push: true tags: | - ghcr.io/loudbooks/pastebook-frontend:${{ env.branch_tag }} + ghcr.io/loudbooks/pastebook-frontend:${{ env.tag }} ghcr.io/loudbooks/pastebook-frontend:${{ env.hash }} - name: Build and push backend Docker image to GHCR @@ -71,7 +64,7 @@ jobs: file: ./backend/Dockerfile push: true tags: | - ghcr.io/loudbooks/pastebook-backend:${{ env.branch_tag }} + ghcr.io/loudbooks/pastebook-backend:${{ env.tag }} ghcr.io/loudbooks/pastebook-backend:${{ env.hash }} - name: Log in to Docker Hub @@ -89,7 +82,7 @@ jobs: file: ./frontend/Dockerfile push: true tags: | - ${{ secrets.DOCKER_USERNAME }}/pastebook-frontend:${{ env.branch_tag }} + ${{ secrets.DOCKER_USERNAME }}/pastebook-frontend:${{ env.tag }} ${{ secrets.DOCKER_USERNAME }}/pastebook-frontend:${{ env.hash }} - name: Build and push backend Docker image to Docker Hub @@ -99,5 +92,5 @@ jobs: file: ./backend/Dockerfile push: true tags: | - ${{ secrets.DOCKER_USERNAME }}/pastebook-backend:${{ env.branch_tag }} + ${{ secrets.DOCKER_USERNAME }}/pastebook-backend:${{ env.tag }} ${{ secrets.DOCKER_USERNAME }}/pastebook-backend:${{ env.hash }}