Skip to content

Registry

Registry #10

Workflow file for this run

name: Registry
# Put 'on' in quotes to avoid YAML parsing error
"on":
# Run on new releases
release:
types:
- published
jobs:
registry:
name: Publish Docker image to GitHub registry
# Pin version of Ubuntu to avoid breaking changes
runs-on: ubuntu-22.04
# Use reasonable timeout to avoid stuck workflows
timeout-minutes: 30
permissions:
# Needed to checkout code
contents: read
# Needed to push to registry
packages: write
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: ./
push: true
# Slashes are here to make the string multiline and avoid using spaces
tags: "\
ghcr.io/radio-aktywne/services/loris\
:latest,\
ghcr.io/radio-aktywne/services/loris\
:${{ github.event.release.tag_name }}"
# Cache Docker layers between builds
cache-from: type=gha,scope=${{ github.workflow }}
cache-to: type=gha,mode=max,scope=${{ github.workflow }}