Skip to content

Maybe got it.

Maybe got it. #6

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
IMAGE_NAME: fastapi-data-collector
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to Github Repo
run: docker login -u $REPO_USERNAME -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
- name: Build the Docker image
run: docker build . --file Dockerfile --tag ghcr.io/$GITHUB_REPOSITORY_OWNER/$IMAGE_NAME:$GITHUB_SHA --tag ghcr.io/$GITHUB_REPOSITORY_OWNER/$IMAGE_NAME:latest
- name: Push to Github Repo
run: |
docker push ghcr.io/$GITHUB_REPOSITORY_OWNER/$IMAGE_NAME:$GITHUB_SHA
docker push ghcr.io/$GITHUB_REPOSITORY_OWNER/$IMAGE_NAME:latest
- name: Logout
run: docker logout