-
Notifications
You must be signed in to change notification settings - Fork 3
101 lines (87 loc) · 2.5 KB
/
docker-build.yaml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Docker Build
on:
push:
branches:
- main
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up cargo cache
uses: actions/cache@v4
continue-on-error: false
with:
path: |
target-common
.devbox
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-docker-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
cargo-docker
cargo-build
- name: Install devbox
uses: jetify-com/devbox-install-action@v0.11.0
with:
enable-cache: 'true'
- name: Update build tag
run: devbox run -- make update_version
- name: Build servers
run: devbox run -- make build_cli_release build_web_release
- name: Docker build signal
uses: mr-smithers-excellent/docker-build-push@v5
with:
image: fledgre/flsignal
registry: docker.io
dockerfile: Dockerfile.flsignal
username: ${{ secrets.DOCKERHUB_NAME }}
password: ${{ secrets.DOCKERHUB }}
tags: latest
- name: Docker build fledger
uses: mr-smithers-excellent/docker-build-push@v5
with:
image: fledgre/fledger
registry: docker.io
dockerfile: Dockerfile.fledger
username: ${{ secrets.DOCKERHUB_NAME }}
password: ${{ secrets.DOCKERHUB }}
tags: latest
- name: Docker build web
uses: mr-smithers-excellent/docker-build-push@v5
with:
image: fledgre/web
registry: docker.io
dockerfile: Dockerfile.web
username: ${{ secrets.DOCKERHUB_NAME }}
password: ${{ secrets.DOCKERHUB }}
tags: latest
publish_crate:
runs-on: ubuntu-latest
needs: docker
steps:
- uses: actions/checkout@v4
- name: Install devbox
uses: jetify-com/devbox-install-action@v0.11.0
with:
enable-cache: 'true'
- name: Publish new crates, if any
run: devbox run -- make publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
deploy:
runs-on: ubuntu-latest
needs: docker
steps:
- name: Update signal.fledg.re
uses: appleboy/ssh-action@master
with:
host: signal.fledg.re
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: |
docker-compose pull -q
docker-compose down
docker-compose up -d