This repository was archived by the owner on Oct 12, 2026. It is now read-only.
Repository navigation
69 lines (57 loc) · 2.3 KB
/
Copy pathdeploy.yml
File metadata and controls
69 lines (57 loc) · 2.3 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
name: Deploy
on:
workflow_dispatch:
inputs:
REVISION:
description: 'Revision to deploy. This accepts any valid reference to a tag, a GIT SHA published or "latest".'
required: true
default: 'latest'
workflow_call:
secrets:
FLY_API_TOKEN:
required: true
FLY_APP_NAME:
required: true
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
concurrency: deploy-group
steps:
- name: Checkout Source
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.REVISION == 'latest' }}
uses: actions/checkout@v4
- name: Checkout Source Version ${{ github.event.inputs.REVISION }}
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.REVISION != 'latest' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.REVISION }}
- name: Git Fetch Unshallow
run: git fetch --prune --unshallow
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull Latest Docker Image from GitHub Container Registry
if: ${{ github.event_name != 'workflow_dispatch' }}
run: docker pull ghcr.io/leoborai/deckmaster:latest
- name: Pull Docker Image Version "${{ github.event.inputs.REVISION }}" from GitHub Container Registry
if: ${{ github.event_name == 'workflow_dispatch' }}
run: docker pull ghcr.io/leoborai/deckmaster:${{ github.event.inputs.REVISION }}
- name: Generate fly.toml from template
run: |
sed "s/{{APP_NAME}}/${{ secrets.FLY_APP_NAME }}/g" ./config/fly.template.toml > fly.toml
- name: Setup flyctl
uses: superfly/flyctl-actions/setup-flyctl@1.5
- name: Deploy Latest to Fly.io
if: ${{ github.event_name != 'workflow_dispatch' }}
run: |
flyctl deploy -i ghcr.io/leoborai/deckmaster:latest
- name: Deploy "${{ github.event.inputs.REVISION }}" to Fly.io
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
flyctl deploy -i ghcr.io/leoborai/deckmaster:${{ github.event.inputs.REVISION }}