-
-
Notifications
You must be signed in to change notification settings - Fork 30
65 lines (57 loc) · 1.65 KB
/
deploy_to_prod.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
name: Deploy to Production
on:
release:
# TODO: Replace this with "released" once we reach 1.0
types: [published]
env:
BANCHAN_DEPLOY_ENV: prod
BANCHAN_HOST: banchan.art
OBAN_KEY_FINGERPRINT: ${{ secrets.OBAN_KEY_FINGERPRINT }}
OBAN_LICENSE_KEY: ${{ secrets.OBAN_LICENSE_KEY }}
jobs:
deploy:
name: Deploy Banchan to Production Server
runs-on: ubuntu-latest
environment:
name: Production
url: https://banchan.art
strategy:
matrix:
elixir: [1.14.5]
otp: [25]
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: superfly/flyctl-actions/setup-flyctl@master
- name: Setup BEAM
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Retrieve Cached Dependencies
uses: actions/cache@v2
id: mix-cache
with:
path: |
deps
_build
priv/plts
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }}
- name: Install Dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: |
mkdir -p priv/plts
mix local.rebar --force
mix local.hex --force
mix deps.get
mix deps.compile
mix dialyzer --plt
- run: mix deploy.prod --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_PROD_DEPLOY_API_TOKEN }}