From 7056a095b039d0c9f81017cc92b08de50161f5a0 Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 7 Jan 2024 17:39:21 -0500 Subject: [PATCH 1/7] Update docker-image.yml --- .github/workflows/docker-image.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index c1b60ed..fea233a 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -5,25 +5,29 @@ on: branches: [ "main" ] pull_request: branches: [ "main" ] + release: + types: [published] jobs: backend-build: - runs-on: ubuntu-latest - steps: - name: Checkout backend code uses: actions/checkout@v3 - - name: Build the Docker image for backend - run: docker build ./backend -t backend-image-name:$(date +%s) + - name: Build and push the Docker image for backend + run: | + docker build ./backend -t my-docker-hub-namespace/backend-image-name:$(date +%s) + echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin + docker push my-docker-hub-namespace/backend-image-name:$(date +%s) frontend-build: - runs-on: ubuntu-latest - steps: - name: Checkout frontend code uses: actions/checkout@v3 - - name: Build the Docker image for frontend - run: docker build ./frontend -t frontend-image-name:$(date +%s) + - name: Build and push the Docker image for frontend + run: | + docker build ./frontend -t my-docker-hub-namespace/frontend-image-name:$(date +%s) + echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin + docker push my-docker-hub-namespace/frontend-image-name:$(date +%s) From b46476f15b349059d2cc23acbd748a1509f6efa2 Mon Sep 17 00:00:00 2001 From: Jaydin_MacBook Date: Sun, 7 Jan 2024 17:46:57 -0500 Subject: [PATCH 2/7] Update docker-image.yml --- .github/workflows/docker-image.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index fea233a..f4c6a9c 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -15,19 +15,23 @@ jobs: steps: - name: Checkout backend code uses: actions/checkout@v3 + with: + path: 'backend' - name: Build and push the Docker image for backend run: | - docker build ./backend -t my-docker-hub-namespace/backend-image-name:$(date +%s) + docker build ${{ github.workspace }}/backend -t themanwholikestocode/archive-me-prod:backend-$(date +%s) echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin - docker push my-docker-hub-namespace/backend-image-name:$(date +%s) + docker push themanwholikestocode/archive-me-prod:backend-$(date +%s) frontend-build: runs-on: ubuntu-latest steps: - name: Checkout frontend code uses: actions/checkout@v3 + with: + path: 'frontend' - name: Build and push the Docker image for frontend run: | - docker build ./frontend -t my-docker-hub-namespace/frontend-image-name:$(date +%s) + docker build ${{ github.workspace }}/frontend -t themanwholikestocode/archive-me-prod:frontend-$(date +%s) echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin - docker push my-docker-hub-namespace/frontend-image-name:$(date +%s) + docker push themanwholikestocode/archive-me-prod:frontend-$(date +%s) From 3006eb57d8ac6ea117e20476a219dbe1c6a0604c Mon Sep 17 00:00:00 2001 From: Jaydin_MacBook Date: Sun, 7 Jan 2024 17:49:11 -0500 Subject: [PATCH 3/7] Update docker-image.yml --- .github/workflows/docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index f4c6a9c..e0b1019 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -19,7 +19,7 @@ jobs: path: 'backend' - name: Build and push the Docker image for backend run: | - docker build ${{ github.workspace }}/backend -t themanwholikestocode/archive-me-prod:backend-$(date +%s) + docker build /backend -t themanwholikestocode/archive-me-prod:backend-$(date +%s) echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin docker push themanwholikestocode/archive-me-prod:backend-$(date +%s) @@ -32,6 +32,6 @@ jobs: path: 'frontend' - name: Build and push the Docker image for frontend run: | - docker build ${{ github.workspace }}/frontend -t themanwholikestocode/archive-me-prod:frontend-$(date +%s) + docker build /frontend -t themanwholikestocode/archive-me-prod:frontend-$(date +%s) echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin docker push themanwholikestocode/archive-me-prod:frontend-$(date +%s) From fabb63af5d366f74db38a6e9693e056db615e8d6 Mon Sep 17 00:00:00 2001 From: Jaydin_MacBook Date: Sun, 7 Jan 2024 17:50:34 -0500 Subject: [PATCH 4/7] Update docker-image.yml --- .github/workflows/docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index e0b1019..3fdb0bb 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -19,7 +19,7 @@ jobs: path: 'backend' - name: Build and push the Docker image for backend run: | - docker build /backend -t themanwholikestocode/archive-me-prod:backend-$(date +%s) + docker build ./backend -t themanwholikestocode/archive-me-prod:backend-$(date +%s) echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin docker push themanwholikestocode/archive-me-prod:backend-$(date +%s) @@ -32,6 +32,6 @@ jobs: path: 'frontend' - name: Build and push the Docker image for frontend run: | - docker build /frontend -t themanwholikestocode/archive-me-prod:frontend-$(date +%s) + docker build ./frontend -t themanwholikestocode/archive-me-prod:frontend-$(date +%s) echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin docker push themanwholikestocode/archive-me-prod:frontend-$(date +%s) From 0f9551da92ca360e0cdd343f370ff445fac48a65 Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 7 Jan 2024 19:11:04 -0500 Subject: [PATCH 5/7] Update docker-image.yml --- .github/workflows/docker-image.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 3fdb0bb..52600c7 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -15,8 +15,7 @@ jobs: steps: - name: Checkout backend code uses: actions/checkout@v3 - with: - path: 'backend' + - name: Build and push the Docker image for backend run: | docker build ./backend -t themanwholikestocode/archive-me-prod:backend-$(date +%s) @@ -28,8 +27,7 @@ jobs: steps: - name: Checkout frontend code uses: actions/checkout@v3 - with: - path: 'frontend' + - name: Build and push the Docker image for frontend run: | docker build ./frontend -t themanwholikestocode/archive-me-prod:frontend-$(date +%s) From 11eb1ac777d436bdcbe0826133863e65e6f123d3 Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 7 Jan 2024 19:31:09 -0500 Subject: [PATCH 6/7] Update docker-image.yml --- .github/workflows/docker-image.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 52600c7..3672109 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -18,9 +18,12 @@ jobs: - name: Build and push the Docker image for backend run: | - docker build ./backend -t themanwholikestocode/archive-me-prod:backend-$(date +%s) + TIMESTAMP=$(date +%s) + docker build ./backend -t themanwholikestocode/archive-me-prod:backend-$TIMESTAMP + docker tag themanwholikestocode/archive-me-prod:backend-$TIMESTAMP domain.com/repo/tag_docker_name:latest echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin - docker push themanwholikestocode/archive-me-prod:backend-$(date +%s) + docker push themanwholikestocode/archive-me-prod:backend-$TIMESTAMP + docker push domain.com/repo/tag_docker_name:latest frontend-build: runs-on: ubuntu-latest @@ -30,6 +33,9 @@ jobs: - name: Build and push the Docker image for frontend run: | - docker build ./frontend -t themanwholikestocode/archive-me-prod:frontend-$(date +%s) + TIMESTAMP=$(date +%s) + docker build ./frontend -t themanwholikestocode/archive-me-prod:frontend-$TIMESTAMP + docker tag themanwholikestocode/archive-me-prod:frontend-$TIMESTAMP domain.com/repo/tag_docker_name:latest echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin - docker push themanwholikestocode/archive-me-prod:frontend-$(date +%s) + docker push themanwholikestocode/archive-me-prod:frontend-$TIMESTAMP + docker push domain.com/repo/tag_docker_name:latest From 7c84416d7673fd879cc9bc40ccabd8dff3bcafd3 Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 7 Jan 2024 19:37:16 -0500 Subject: [PATCH 7/7] Update docker-image.yml --- .github/workflows/docker-image.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 3672109..cb56431 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -23,7 +23,6 @@ jobs: docker tag themanwholikestocode/archive-me-prod:backend-$TIMESTAMP domain.com/repo/tag_docker_name:latest echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin docker push themanwholikestocode/archive-me-prod:backend-$TIMESTAMP - docker push domain.com/repo/tag_docker_name:latest frontend-build: runs-on: ubuntu-latest @@ -38,4 +37,3 @@ jobs: docker tag themanwholikestocode/archive-me-prod:frontend-$TIMESTAMP domain.com/repo/tag_docker_name:latest echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin docker push themanwholikestocode/archive-me-prod:frontend-$TIMESTAMP - docker push domain.com/repo/tag_docker_name:latest