Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
TheManWhoLikesToCode authored Jan 8, 2024
1 parent 0f9551d commit 11eb1ac
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 11eb1ac

Please sign in to comment.