Skip to content

Commit

Permalink
Merge pull request #26 from TheManWhoLikesToCode/TheManWhoLikesToCode…
Browse files Browse the repository at this point in the history
…-patch-2

push docker image to dockerhub
  • Loading branch information
TheManWhoLikesToCode authored Jan 8, 2024
2 parents 5112c55 + 7c84416 commit 4578319
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,35 @@ 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: |
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-$TIMESTAMP
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: |
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-$TIMESTAMP

0 comments on commit 4578319

Please sign in to comment.