Merge pull request #634 from TheEadie/renovate/theeadie-worms-server-… #50
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |