tangled
alpha
login
or
join now
danabra.mov
/
slices
forked from
slices.network/slices
0
fork
atom
Highly ambitious ATProtocol AppView service and sdks
0
fork
atom
overview
issues
pulls
pipelines
add release workflow for api
chadtmiller.com
5 months ago
3c0912f3
a317ce34
+58
1 changed file
expand all
collapse all
unified
split
.github
workflows
release.yml
+58
.github/workflows/release.yml
···
1
1
+
name: Release API Container
2
2
+
3
3
+
on:
4
4
+
push:
5
5
+
tags:
6
6
+
- 'v*'
7
7
+
8
8
+
jobs:
9
9
+
release:
10
10
+
runs-on: ubuntu-latest
11
11
+
defaults:
12
12
+
run:
13
13
+
working-directory: api
14
14
+
15
15
+
steps:
16
16
+
- name: Checkout code
17
17
+
uses: actions/checkout@v4
18
18
+
19
19
+
- name: Install Nix
20
20
+
uses: DeterminateSystems/nix-installer-action@main
21
21
+
with:
22
22
+
logger: pretty
23
23
+
24
24
+
- name: Setup Nix cache
25
25
+
uses: DeterminateSystems/magic-nix-cache-action@main
26
26
+
27
27
+
- name: Check flake
28
28
+
run: nix flake check --refresh
29
29
+
30
30
+
- name: Build Rust binary
31
31
+
run: nix build .#slices
32
32
+
33
33
+
- name: Build Docker image
34
34
+
run: nix build .#slicesImg
35
35
+
36
36
+
- name: Load Docker image
37
37
+
run: docker load < result
38
38
+
39
39
+
- name: Login to GitHub Container Registry
40
40
+
uses: docker/login-action@v3
41
41
+
with:
42
42
+
registry: ghcr.io
43
43
+
username: ${{ github.actor }}
44
44
+
password: ${{ secrets.GITHUB_TOKEN }}
45
45
+
46
46
+
- name: Extract tag name
47
47
+
id: tag
48
48
+
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
49
49
+
50
50
+
- name: Tag for GitHub Container Registry
51
51
+
run: |
52
52
+
docker tag slices:latest ghcr.io/${{ github.repository }}/api:latest
53
53
+
docker tag slices:latest ghcr.io/${{ github.repository }}/api:${{ steps.tag.outputs.tag }}
54
54
+
55
55
+
- name: Push to GitHub Container Registry
56
56
+
run: |
57
57
+
docker push ghcr.io/${{ github.repository }}/api:latest
58
58
+
docker push ghcr.io/${{ github.repository }}/api:${{ steps.tag.outputs.tag }}