Set up Azure environment #98
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: Set up Azure environment | |
on: workflow_dispatch | |
permissions: | |
id-token: write | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
environment: | |
name: production | |
steps: | |
- name: Login to azure 🔑 | |
id: login-to-azure | |
uses: azure/login@v1 | |
with: | |
client-id: d58b2e85-2d34-4cdb-ad70-5f2b767dd8e2 | |
tenant-id: 3aa4a235-b6e2-48d5-9195-7fcf05b459b0 | |
allow-no-subscriptions: true | |
- name: Show Azure account | |
run: az account show | |
# Checkout internal repository where the bicep files are located | |
- name: Checkout internal 🛎️ | |
id: checkout-internal | |
uses: actions/checkout@v3 | |
with: | |
repository: 'equinor/design-system-internal' | |
ref: main | |
token: ${{ secrets.PAT_INTERNAL }} | |
# Do the actual deployment | |
- name: deploy 🚀 | |
id: deploy | |
uses: azure/arm-deploy@v1 | |
with: | |
scope: subscription | |
region: northeurope | |
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }} | |
template: .azure/main.bicep | |
parameters: 'location=northeurope' | |
failOnStdErr: false | |
- name: logout 🔓 | |
run: | | |
az logout | |
if: always() | |
- name: log-errors-to-slack | |
uses: act10ns/slack@v2 | |
with: | |
status: ${{ job.status }} | |
steps: ${{ toJson(steps) }} | |
if: failure() |