-
Notifications
You must be signed in to change notification settings - Fork 3
66 lines (52 loc) · 1.52 KB
/
publish-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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Publish Docker Image
on:
push:
branches:
- main
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
env:
IMAGE_NAME: commune
jobs:
publish_image:
name: Publish image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: x86_64-unknown-linux-musl
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
- name: Setup Rust Target
run: rustup target add x86_64-unknown-linux-musl
- name: Setup Zig
uses: goto-bus-stop/[email protected]
- name: Install ZigBuild
run: cargo install cargo-zigbuild
- name: Install Build Dependencies
run: |
sudo apt-get update
sudo apt-get install \
pkg-config \
libssl-dev
- name: Install Just
uses: extractions/setup-just@v1
- name: Build Image
run: just docker_build_image
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish image to GitHub Container Registry
run: just docker_publish_image