Skip to content

tag images

tag images #3

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "main","Day29" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build ./backend --tag fastapi-ithome2023:latest
- name: Tag the Docker image
run: docker tag fastapi-ithome2023:latest ${{ secrets.DOCKERHUB_USERNAME }}/fastapi-ithome2023:latest
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push image to DockerHub
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/fastapi-ithome2023:latest