-
Notifications
You must be signed in to change notification settings - Fork 8
44 lines (44 loc) · 1.43 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Publish Docker Image
on:
release:
types:
- published
workflow_dispatch:
jobs:
publish-image:
concurrency: publish-image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable-small
- uses: cachix/cachix-action@v15
with:
name: protoletariat
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: nix-community,poetry2nix
- run: nix run --print-build-logs --keep-going '.#protoletariat-image.copyToDockerDaemon'
- run: echo "FROM protoletariat:$(nix eval --raw '.#protoletariat-image.imageTag')" > Dockerfile
- uses: docker/metadata-action@v4
id: meta
with:
images: |
ghcr.io/${{ github.repository_owner }}/protoletariat
tags: |
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=sha
type=sha,format=long
- uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}