Merge pull request #140 from equinor/master #37
This file contains hidden or 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 Database | |
| on: | |
| push: | |
| branches: [master, release] | |
| workflow_dispatch: | |
| 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@v2 | |
| 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/[email protected] | |
| if: matrix.target.ref == github.ref | |
| with: | |
| connection-string: ${{env.connection}} | |
| path: './azure-infrastructure/preDeployScript.sql' | |
| - uses: azure/[email protected] | |
| if: matrix.target.ref == github.ref | |
| with: | |
| connection-string: ${{env.connection}} | |
| path: './azure-infrastructure/createSchema.sql' | |
| arguments: '-v RADIX_ZONE=${{matrix.target.name}}' | |
| - uses: azure/[email protected] | |
| if: matrix.target.ref == github.ref | |
| with: | |
| connection-string: ${{env.connection}} | |
| path: './azure-infrastructure/createTables.sql' | |
| - uses: azure/[email protected] | |
| if: matrix.target.ref == github.ref | |
| with: | |
| connection-string: ${{env.connection}} | |
| path: './azure-infrastructure/createTypes.sql' | |
| - uses: azure/[email protected] | |
| if: matrix.target.ref == github.ref | |
| with: | |
| connection-string: ${{env.connection}} | |
| path: './azure-infrastructure/createProcedures.sql' |