Deploy dacpac package to Azure SQL #2
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
## Secrets Required: Azure SQL Connection String: | |
# AZURE_SQL_CONNECTION_STRING: 'Server=tcp:yourserver.database.windows.net,1433;Initial Catalog=yourdatabase;Persist Security Info=False;User ID=yourusername;Password=yourpassword;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;' | |
name: Deploy dacpac package to Azure SQL | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: 'Environment' | |
required: true | |
default: 'dev' | |
options: | |
dev: | |
- 'dev' | |
staging: | |
- 'staging' | |
prod: | |
- 'prod' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: | |
name: ${{ github.event.inputs.environment }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: azure/[email protected] | |
with: | |
connection-string: ${{ secrets.AZURE_SQL_CONNECTION_STRING }} | |
path: './DbProject/DbProject.sqlproj' | |
action: 'publish' | |
build-arguments: '-c Release' # Optional build options passed to dotnet build | |
arguments: '/p:DropObjectsNotInSource=true' # Optional properties and parameters for SqlPackage Publish |