-
Notifications
You must be signed in to change notification settings - Fork 5
57 lines (50 loc) · 1.69 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
52
53
54
55
56
57
name: Deploy
on:
push:
paths:
- "deployment/worms.davideadie.dev/**"
- ".github/workflows/deploy.yml"
branches:
- main
jobs:
deploy:
name: Azure Infrastructure
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.x
- name: Pulumi Up
id: pulumi-up
uses: pulumi/actions@v4
with:
command: up
stack-name: prod
work-dir: deployment/worms.davideadie.dev
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
- name: Get Version
id: database-version
run: echo "version=$(cat deployment/worms.davideadie.dev/database-version.txt)" >> $GITHUB_OUTPUT
- name: Run Flyway Migrate
uses: docker://redgate/flyway:9
with:
args: >-
info
migrate
info
-locations="filesystem:/github/workspace/src/database/migrations"
-configFiles="/github/workspace/src/database/flyway.conf"
-url="${{ steps.pulumi-up.outputs.database-jdbc }}"
-user="${{ steps.pulumi-up.outputs.database-user }}"
-password="${{ steps.pulumi-up.outputs.database-password }}"
-target=${{ steps.database-version.outputs.version }}
env:
FLYWAY_LICENSE_KEY: ${{ secrets.FLYWAY_LICENSE_KEY }}