51 lines (43 loc) · 1.16 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: deploy
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "**.edn"
- "**.css"
- "**.js"
- "**.clj"
- "**.yml"
- "**.toml"
- "Dockerfile"
- "**.md"
jobs:
Deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup deploy environment
uses: superfly/flyctl-actions/setup-flyctl@master
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to fly.io docker registry
run: flyctl auth docker
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: Build
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: "registry.fly.io/luciano-laratelli:${{ github.sha }}"
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Deploy
run: flyctl deploy --app luciano-laratelli --image "registry.fly.io/luciano-laratelli:${{ github.sha }}"
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}