Skip to content

push docker image to dockerhub #28

push docker image to dockerhub

push docker image to dockerhub #28

Workflow file for this run

name: Docker Image CI
on:
push:
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 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
docker push domain.com/repo/tag_docker_name:latest
frontend-build:
runs-on: ubuntu-latest
steps:
- name: Checkout frontend code
uses: actions/checkout@v3
- 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
docker push domain.com/repo/tag_docker_name:latest