name: build-release
on:
  # this is meant to be run on an approved PR branch for convenience
  workflow_dispatch:
jobs:
  build:
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - name: Clone repository
        uses: actions/checkout@v2

      - name: Log into container registry
        run: podman login -u cockpituous -p ${{ secrets.COCKPITUOUS_GHCR_TOKEN }} ghcr.io

      - name: Build release container
        run: make release-container

      - name: Push container to registry
        run: make release-push

name: build-release
on:
  # this is meant to be run on an approved PR branch for convenience
  workflow_dispatch:
jobs:
  build:
    runs-on: ubuntu-latest
    timeout-minutes: 30
    permissions:
      contents: read
      packages: write
    steps:
      - name: Clone repository
        uses: actions/checkout@v2

      - name: Log into container registry
        run: podman login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io

      - name: Build release container
        run: make release-container

      - name: Push container to registry
        run: make release-push

Use default GitHub token for pushing to ghcr.io
workflows: Use default GitHub token for pushing to ghcr.io

This is now possible with the recently introduced fine-grained
permissions:
https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions
