Skip to content

Commit 14a7ea4

Browse files
Push oci images on release
1 parent f8e190d commit 14a7ea4

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/push.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Push Docker Image
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
docker:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
packages: write
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: nixbuild/nix-quick-install-action@v28
18+
with:
19+
nix_conf: experimental-features = nix-command flakes
20+
21+
# Log in to GHCR
22+
- name: Log in to GHCR
23+
uses: docker/login-action@v3
24+
with:
25+
registry: ghcr.io
26+
username: ${{ github.actor }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
29+
# Create a docker image
30+
- run: nix run .#packages.x86_64-linux.container.copyToDockerDaemon
31+
- run: docker tag perfly:latest ghcr.io/artificialio/perfly:${{ github.event.release.tag_name }}
32+
33+
# Build and push the image
34+
- name: Build and Push Docker image
35+
uses: docker/build-push-action@v6
36+
with:
37+
context: .
38+
push: true
39+
tags: |
40+
ghcr.io/artificialio/perfly:latest
41+
ghcr.io/artificialio/perfly:${{ github.event.release.tag_name }}

0 commit comments

Comments
 (0)