-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1.07 KB
/
fly-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
name: Deploy Backend
on:
push:
branches: [ main ]
jobs:
deploy:
name: Deploy to Fly.io
runs-on: ubuntu-latest
defaults:
run:
working-directory: postrify-backend
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
- name: Build with Maven
run: mvn clean package -DskipTests
- name: Install Flyctl
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Set Fly.io Secrets
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
run: |
flyctl secrets set SPRING_DATASOURCE_URL="${{ secrets.SPRING_DATASOURCE_URL }}"
flyctl secrets set SPRING_DATASOURCE_USERNAME="${{ secrets.SPRING_DATASOURCE_USERNAME }}"
flyctl secrets set SPRING_DATASOURCE_PASSWORD="${{ secrets.SPRING_DATASOURCE_PASSWORD }}"
- name: Deploy to Fly.io
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
run: flyctl deploy --remote-only