Skip to content

Publish Docker Image to GHCR #65

Publish Docker Image to GHCR

Publish Docker Image to GHCR #65

Workflow file for this run

name: Publish Docker Image to GHCR
on: workflow_dispatch
jobs:
build-push:
name: Build and Push to GHCR
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Login to GitHub Container registry
uses: docker/login-action@v1
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
registry: ghcr.io
username: $GITHUB_USER
password: ${{ secrets.GITHUB_TOKEN }}
- name: downcase REPO
run: |
echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
echo ${REPO}
echo ${GITHUB_REPOSITORY}
- name: Build and Push
env:
REGISTRY: ghcr.io
run: |
docker build -t $REGISTRY/${REPO}:latest -t $REGISTRY/${REPO}:$(date +%s) .
docker push $REGISTRY/${REPO} --all-tags