File tree Expand file tree Collapse file tree 5 files changed +71
-3
lines changed
Expand file tree Collapse file tree 5 files changed +71
-3
lines changed Original file line number Diff line number Diff line change 1+ name : Cryptography Service
2+
3+ on :
4+ push :
5+ branches : [ "**" ]
6+ pull_request :
7+ branches : [ "main" ]
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Install rust
14+ uses : moonrepo/setup-rust@v1
15+ - name : Login to Github registry
16+ uses : docker/login-action@v2
17+ with :
18+ registry : ghcr.io
19+ username : ${{ github.actor }}
20+ password : ${{ secrets.GITHUB_TOKEN }}
21+ - name : Checkout code
22+ uses : actions/checkout@v4
23+ - name : Build and push versioned Docker image
24+ run : |
25+ cd ./services/cryptography
26+ cargo build
27+ cargo test
28+ version=$( cargo pkgid | cut -d '@' -f 2 )
29+ docker build . --tag ghcr.io/${{ github.repository }}/cryptography:$version
30+ docker push ghcr.io/${{ github.repository }}/cryptography:$version
31+ - name : Retag and push latest Docker image
32+ if : github.ref == 'refs/heads/main'
33+ run : |
34+ docker tag ghcr.io/${{ github.repository }}/cryptography:$( cargo pkgid | cut -d '@' -f 2 ) \
35+ ghcr.io/${{ github.repository }}/cryptography:latest
36+ docker push ghcr.io/${{ github.repository }}/cryptography:latest
Original file line number Diff line number Diff line change 1+ name : Explorer Service
2+
3+ on :
4+ push :
5+ branches : [ "**" ]
6+ pull_request :
7+ branches : [ "main" ]
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Login to Github registry
14+ uses : docker/login-action@v2
15+ with :
16+ registry : ghcr.io
17+ username : ${{ github.actor }}
18+ password : ${{ secrets.GITHUB_TOKEN }}
19+ - name : Checkout code
20+ uses : actions/checkout@v4
21+ - name : Build and push versioned Docker image
22+ run : |
23+ version=$( cat ./services/explorer/version.txt )
24+ docker build ./services/explorer --tag ghcr.io/${{ github.repository }}/explorer:$version
25+ docker push ghcr.io/${{ github.repository }}/explorer:$version
26+ - name : Retag and push latest Docker image
27+ if : github.ref == 'refs/heads/main'
28+ run : |
29+ docker tag ghcr.io/${{ github.repository }}/explorer:$( cat ./services/explorer/version.txt ) \
30+ ghcr.io/${{ github.repository }}/explorer:latest
31+ docker push ghcr.io/${{ github.repository }}/explorer:latest
Original file line number Diff line number Diff line change 11[package ]
22name = " cryptography-service"
3- version = " 0.1 .0"
3+ version = " 1.0 .0"
44edition = " 2021"
55
66[dependencies ]
Original file line number Diff line number Diff line change 11# --- Build ---
22
3- FROM alpine:latest AS builder
3+ FROM alpine:3.21.3 AS builder
44
55ENV CC=clang
66ENV CXX=clang++
@@ -17,7 +17,7 @@ RUN cargo build --release
1717
1818# --- Deploy ---
1919
20- FROM alpine:latest
20+ FROM alpine:3.21.3
2121
2222WORKDIR /srv
2323COPY --from=builder /usr/lib/libgcc_s.so.1 /usr/lib/
Original file line number Diff line number Diff line change 1+ 1.0.0
You can’t perform that action at this time.
0 commit comments