Repository navigation
53 lines (50 loc) · 2.29 KB
/
Copy pathdeploy-stack.yml
File metadata and controls
53 lines (50 loc) · 2.29 KB
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
name: deploy-stack
# Builds the production images and runs the whole compose stack (Caddy + backend + relay +
# Postgres) with two fsync-cli devices syncing through it. Only when deploy inputs change.
on:
pull_request:
paths: ["deploy/**", "backend/**", "core/**", "Cargo.lock", "tests/e2e/compose-stack-sync.sh", ".github/workflows/deploy-stack.yml"]
push:
branches: [main]
paths: ["deploy/**", "backend/**", "core/**", "Cargo.lock", "tests/e2e/compose-stack-sync.sh", ".github/workflows/deploy-stack.yml"]
workflow_dispatch:
concurrency:
group: deploy-stack-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
stack:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: dtolnay/rust-toolchain@fb523f40495206854c36b250850817ae0f83e3d1 # 1.99.0
with: { toolchain: "1.99.0" }
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
# Docker layer cache (GitHub cache backend): the cross-compile image builds are the slow part.
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: .
file: deploy/backend/Dockerfile
tags: fsync-backend:local
load: true
cache-from: type=gha,scope=backend
cache-to: type=gha,mode=max,scope=backend
- uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: deploy/relay
tags: fsync-relay:local
load: true
cache-from: type=gha,scope=relay
cache-to: type=gha,mode=max,scope=relay
- name: Lint deploy scripts and compose file
run: |
shellcheck -S warning deploy/scripts/*.sh deploy/relay/entrypoint.sh tests/e2e/compose-stack-sync.sh
deploy/scripts/gen-env.sh > "$RUNNER_TEMP/deploy.env"
docker compose --env-file "$RUNNER_TEMP/deploy.env" -f deploy/compose.yml config -q
RELAY_HOST=relay.example.test docker compose -f deploy/compose.relay-only.yml config -q
- name: Compose stack end to end
env: { SKIP_BUILD: "1" }
run: tests/e2e/compose-stack-sync.sh