Skip to content

Commit 4a0a08b

Browse files
authored
build: docker image (#4)
1 parent 2c74cfa commit 4a0a08b

File tree

9 files changed

+2873
-12
lines changed

9 files changed

+2873
-12
lines changed

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
target
2+
debug
3+
.git
4+
.gitignore
5+
.vscode
6+
.idea
7+
terraform
8+
*.log
9+
**/*.rs.bk

.github/workflows/release.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,20 @@ jobs:
2424
- name: Install Rust
2525
uses: dtolnay/rust-toolchain@stable
2626
with:
27-
toolchain: stable
27+
toolchain: "1.91.0"
28+
29+
- name: Derive version from tag
30+
id: meta
31+
run: echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
32+
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
36+
- name: Log in to Docker Hub
37+
uses: docker/login-action@v3
38+
with:
39+
username: ${{ secrets.DOCKERHUB_USERNAME }}
40+
password: ${{ secrets.DOCKERHUB_TOKEN }}
2841

2942
- name: Cache cargo
3043
uses: actions/cache@v3
@@ -37,7 +50,16 @@ jobs:
3750

3851
- name: Build release
3952
run: cargo build --release
40-
53+
54+
- name: Build and push Docker image
55+
uses: docker/build-push-action@v5
56+
with:
57+
context: .
58+
push: true
59+
tags: |
60+
dashpay/quorum-list-server:latest
61+
dashpay/quorum-list-server:${{ steps.meta.outputs.version }}
62+
4163
- name: Create release archive
4264
run: |
4365
cd target/release
@@ -49,4 +71,4 @@ jobs:
4971
files: target/release/quorum-list-server-linux-x86_64.tar.gz
5072
generate_release_notes: true
5173
env:
52-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ target/
1111
# Visual Studo Code configuration
1212
.vscode/
1313

14-
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
15-
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
16-
Cargo.lock
17-
1814
# These are backup files generated by rustfmt
1915
**/*.rs.bk
2016

0 commit comments

Comments
 (0)