diff --git a/.github/workflows/docker_ghcr.yaml b/.github/workflows/docker_ghcr.yaml new file mode 100644 index 0000000..0f6981d --- /dev/null +++ b/.github/workflows/docker_ghcr.yaml @@ -0,0 +1,28 @@ +name: "Publish Docker image" +# Name of this action (else will name after the commits) +run-name: Publish Docker image on GitHub container registry (ghcr.io) + +# Source: https://dev.to/github/publishing-a-docker-image-to-githubs-container-repository-4n50 + +on: [push] + +jobs: + Publish-docker-image: + runs-on: ubuntu-latest + name: Publish docker image + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build the Docker image + run: | + docker build . --tag ghcr.io/pythonhealthdatascience/covid19:latest + docker push ghcr.io/pythonhealthdatascience/covid19:latest \ No newline at end of file