-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from XPRTZ/feature/setup-pipelines
Updating pipeline setup
Showing
2 changed files
with
53 additions
and
18 deletions.
There are no files selected for viewing
28 changes: 10 additions & 18 deletions
28
.github/workflows/infrastructure.yml → .github/workflows/deployment.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,34 @@ | ||
name: Infrastructure workflow | ||
name: Deploy infrastructure | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: [ main ] | ||
push: | ||
branches: [ main ] | ||
branches: [main] | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
Deploy: | ||
deploy-infrastructure: | ||
name: Deploy infrastructure | ||
runs-on: ubuntu-latest | ||
environment: production | ||
steps: | ||
- uses: actions/checkout@main | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Azure login | ||
uses: azure/login@v1 | ||
uses: azure/login@v2 | ||
with: | ||
client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
|
||
- name: Show subscription details | ||
uses: azure/CLI@v1 | ||
with: | ||
azcliversion: latest | ||
inlineScript: | | ||
az account show | ||
- name: Deploy infrastructure | ||
uses: azure/arm-deploy@v1 | ||
uses: azure/arm-deploy@v2 | ||
with: | ||
scope: subscription | ||
region: westeurope | ||
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
template: ./main.bicep | ||
failOnStdErr: false | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Pull request | ||
run-name: Pull request build for ${{ github.head_ref }} | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: [main] | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
env: | ||
BICEP_FILE: ./main.bicep | ||
|
||
jobs: | ||
verify-bicep-files: | ||
name: Validate Bicep files | ||
runs-on: ubuntu-latest | ||
environment: production | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Azure login | ||
uses: azure/login@v2 | ||
with: | ||
client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
|
||
- name: Build Bicep files | ||
uses: Azure/cli@v2 | ||
with: | ||
inlineScript: az bicep build --file ${{ env.BICEP_FILE }} | ||
|
||
- name: Validate Bicep deployment on subscription level | ||
uses: Azure/cli@v2 | ||
with: | ||
inlineScript: | | ||
az deployment sub validate \ | ||
--name validate-${{ github.run_id }} \ | ||
--template-file ${{ env.BICEP_FILE }} \ | ||
--location westeurope |