Skip to content

Publish image to GitHub Package Registry #187

Publish image to GitHub Package Registry

Publish image to GitHub Package Registry #187

Workflow file for this run

name: Publish image to GitHub Package Registry
on:
workflow_dispatch:
push:
branches:
- main
schedule:
- cron: '0 0 * * 0' # Weekly
jobs:
Publish:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Publish
run: |
docker build $GITHUB_WORKSPACE --tag "docker-image"
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
docker tag docker-image ghcr.io/charlesnicholson/docker-image:latest
docker push ghcr.io/charlesnicholson/docker-image:latest