Skip to content

push docker image to dockerhub #24

push docker image to dockerhub

push docker image to dockerhub #24

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
with:
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)
echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
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 ${{ 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 themanwholikestocode/archive-me-prod:frontend-$(date +%s)