Skip to content

Merge pull request #123 from equinor/refactor-chart-deployment #20

Merge pull request #123 from equinor/refactor-chart-deployment

Merge pull request #123 from equinor/refactor-chart-deployment #20

name: Deploy Database
on:
push:
branches: [master, release]
permissions:
id-token: write
jobs:
deploy:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
target:
- name: "dev"
ref: "refs/heads/master"
client-id: "8dcdedf9-b297-4c00-864a-ea52e7ec8732"
server: "sql-radix-cost-allocation-dev.database.windows.net"
- name: "playground"
ref: "refs/heads/release"
client-id: "12038969-a194-423c-8ff8-d8dc200c0d79"
server: "sql-radix-cost-allocation-playground.database.windows.net"
- name: "platform"
ref: "refs/heads/release"
client-id: "5dd06410-a4dd-4616-8fda-090d23b1528c"
server: "sql-radix-cost-allocation-platform.database.windows.net"
- name: "c2"
ref: "refs/heads/release"
client-id: "820a9ea1-9d2f-4056-9271-d2865cc70fb6"
server: "sql-radix-cost-allocation-c2.database.windows.net"
env:
connection: >-
Server=${{matrix.target.server}};
Initial Catalog=sqldb-radix-cost-allocation;
Authentication=Active Directory Default;
Encrypt=True;
TrustServerCertificate=False;
Connection Timeout=30;
steps:
- uses: actions/checkout@v4
if: matrix.target.ref == github.ref
- uses: azure/login@v1
if: matrix.target.ref == github.ref
with:
client-id: ${{matrix.target.client-id}}
tenant-id: "3aa4a235-b6e2-48d5-9195-7fcf05b459b0"
allow-no-subscriptions: true
- uses: azure/sql-action@v2.2.1
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/preDeployScript.sql'
- uses: azure/sql-action@v2.2.1
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/createSchema.sql'
- uses: azure/sql-action@v2.2.1
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/createTables.sql'
- uses: azure/sql-action@v2.2.1
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/createTypes.sql'
- uses: azure/sql-action@v2.2.1
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/createProcedures.sql'