-
Notifications
You must be signed in to change notification settings - Fork 68
77 lines (71 loc) · 2.28 KB
/
github_release_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
67
68
69
70
71
72
73
74
75
76
77
name: Build + Release docker
on:
push:
tags:
- 'v*'
jobs:
rust_build:
name: Build Nimiq with release flag
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build binaries in release mode
run: |
cargo build --release
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: nimiq-dist
path: |
target/release/nimiq-client
target/release/nimiq-bls
target/release/nimiq-address
target/release/nimiq-rpc
build_docker:
runs-on: ubuntu-22.04
name: Build & publish docker image
needs: rust_build
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download nimiq client artifact from previous job
uses: actions/download-artifact@v4
with:
name: nimiq-dist
path: target/release/
- name: Run some commands
run: |
ls target/release/ -al
chmod -R +x target/release/
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
flavor: latest=true
- name: Login to image repository
if: github.ref_type == 'tag'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
with:
context: .
file: Dockerfile
push: ${{ github.ref_type == 'tag' }}
# This is required or a package with unknown architecture will be published too.
# See https://github.com/docker/build-push-action/issues/820 for further
# details.
# TODO - investigate further and see if we can find a solution where we
# don't have to set this.
provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha