Also build and push docker containers on git tags (#11) #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Publish | |
on: | |
push: | |
branches: ["main"] | |
tags: ["*"] | |
jobs: | |
docker-build: | |
runs-on: ubuntu-24.04 | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build Docker image | |
run: docker build -t "${REGISTRY}/${IMAGE_NAME}:${GITHUB_REF_NAME}" . | |
- name: Push Docker image | |
run: docker push "${REGISTRY}/${IMAGE_NAME}:${GITHUB_REF_NAME}" |