From 11eb1ac777d436bdcbe0826133863e65e6f123d3 Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 7 Jan 2024 19:31:09 -0500 Subject: [PATCH] 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