-
Notifications
You must be signed in to change notification settings - Fork 3
75 lines (65 loc) · 2.05 KB
/
deploy.yml
File metadata and controls
75 lines (65 loc) · 2.05 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Deploy
on:
workflow_run:
workflows: ["CI"]
branches: [master]
types: [completed]
workflow_dispatch:
inputs:
target:
description: 'Deploy target'
required: true
type: choice
options:
- runtime
- web
- all
environment:
description: 'Environment'
required: true
type: choice
options:
- staging
- production
permissions:
contents: read
deployments: write
jobs:
auto-deploy:
if: >
github.event_name == 'workflow_run' &&
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.run_attempt == 1 &&
github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}
- uses: superfly/flyctl-actions/setup-flyctl@fc53c09e1bc3be6f54706524e3b82c4f462f77be # v2
- name: Deploy web
run: flyctl deploy --config infra/fly/fly.web.toml --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: Deploy runtime
run: flyctl deploy --config infra/fly/fly.runtime.toml --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
manual-deploy:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@fc53c09e1bc3be6f54706524e3b82c4f462f77be # v2
- name: Deploy runtime
if: inputs.target == 'runtime' || inputs.target == 'all'
run: flyctl deploy --config infra/fly/fly.runtime.toml --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: Deploy web
if: inputs.target == 'web' || inputs.target == 'all'
run: flyctl deploy --config infra/fly/fly.web.toml --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}