-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (30 loc) · 1014 Bytes
/
deploy.yml
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
name: deploy
run-name: "Deploy from ${{ github.event.workflow_run.head_branch }} (${{ github.event.workflow_run.head_commit.message }})"
on:
workflow_run:
workflows: [check]
branches: [main]
types: [completed]
concurrency:
group: "${{ github.event.workflow_run.head_branch }}-${{ github.event.workflow_run.conclusion }}"
cancel-in-progress: true
jobs:
deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
timeout-minutes: 10
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}
fetch-depth: 0
- name: Set up Flyctl
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Deploy
run: flyctl deploy --remote-only --ha=false --memory=512
- name: Revert deployment on failure
if: failure() || cancelled()
run: flyctl scale count 1 --yes