Skip to content

Build and Push image to GHCR #18

Build and Push image to GHCR

Build and Push image to GHCR #18

Workflow file for this run

name: Build and Push image to GHCR
on:
push:
branches:
- main
workflow_dispatch:
permissions:
packages: write
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: ghcr.io/${{ github.repository }}:${{ env.GITHUB_SHA_SHORT }}