Skip to content

More configurable env vars #16

More configurable env vars

More configurable env vars #16

name: Docker Publish
on:
push:
branches: [master]
paths-ignore:
- 'README.md'
- 'docs/**'
- '**.png'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
- name: Convert repository name to lowercase
run: echo "REPO_NAME=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Get short SHA
id: short_sha
run: echo "::set-output name=sha::$(git rev-parse --short HEAD)"
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ steps.meta.outputs.tags }}
ghcr.io/${{ env.REPO_NAME }}:latest
ghcr.io/${{ env.REPO_NAME }}:${{ steps.short_sha.outputs.sha }}