Skip to content

added latest tag

added latest tag #9

Workflow file for this run

name: Docker Image CI for GHCR
on:
push:
branches:
- production
jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to GitHub Container Registry
run: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GHCR_PAT }}
- name: Set ghcr.io url
run: echo "REPO=${GITHUB_REPOSITORY@L}" >> "${GITHUB_ENV}"
- name: Build the Docker image
run: |
docker build . -t ghcr.io/${{ env.REPO }}:${{ github.sha }}
docker tag ghcr.io/${{ env.REPO }}:${{ github.sha }} ghcr.io/${{ env.REPO }}:latest
- name: Push the Docker image
run: |
docker push ghcr.io/${{ env.REPO }}:${{ github.sha }}
docker push ghcr.io/${{ env.REPO }}:latest