Skip to content

Build and publish Docker image #3

Build and publish Docker image

Build and publish Docker image #3

Workflow file for this run

name: "Build and publish Docker image"
on:
release:
types: [published]
workflow_dispatch:
env:
REGISTRY: ghcr.io
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Use Nix to build a Docker image
run: nix build -L '.#docker-image'
- name: Log into registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Import image and push
run: |
docker load -i result
docker push ghcr.io/typst/$(docker images --format json | jq -r 'select(.Repository == "typst-package-check") | .Repository + ":" + .Tag')