Skip to content

Commit

Permalink
new GHA opex dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
jacopocarlini committed May 25, 2023
1 parent 65d4e8a commit c73a57a
Showing 1 changed file with 7 additions and 39 deletions.
46 changes: 7 additions & 39 deletions .github/workflows/create_dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ on:

workflow_dispatch:

env:
TEMPLATE_DIR: azure-dashboard

permissions:
id-token: write
contents: read
Expand All @@ -39,43 +36,14 @@ jobs:
with:
persist-credentials: false

- name: Read terraform version
id: read-version
shell: bash
run: |
echo "TERRAFORM_VERSION=`cat .terraform-version`" >> $GITHUB_ENV
- name: Setup Terraform
# from https://github.com/hashicorp/setup-terraform/commits/main
uses: hashicorp/setup-terraform@8feba2b913ea459066180f9cb177f58a881cf146
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}

- name: Login
id: login
# from https://github.com/Azure/login/commits/master
uses: azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2
# from https://github.com/pagopa/opex-dashboard-azure-action/
- uses: pagopa/opex-dashboard-azure-action@v1.1.2
with:
environment: ${{ matrix.environment }}
api-name:
config: .opex/env/${{ matrix.environment }}/config.yaml
client-id: ${{ secrets.CLIENT_ID }}
tenant-id: ${{ secrets.TENANT_ID }}
subscription-id: ${{ secrets.SUBSCRIPTION_ID }}

# this action create a folder named /azure-dashboard
- uses: pagopa/opex-dashboard-action@main
with:
template: ${{ env.TEMPLATE_DIR }}
config: .opex/env/${{ matrix.environment }}/config.yaml

# we need to set env variables in the folder /azure-dashboard
- name: Copy Environments
run: |
cp -R .opex/env ./${TEMPLATE_DIR}
# now is possible to launch the command: terraform apply
- name: Terraform Apply
shell: bash
run: |
cd ./${TEMPLATE_DIR}
export ARM_CLIENT_ID="${{ secrets.CLIENT_ID }}"
export ARM_SUBSCRIPTION_ID=$(az account show --query id --output tsv)
export ARM_TENANT_ID=$(az account show --query tenantId --output tsv)
export ARM_USE_OIDC=true
bash ./terraform.sh apply ${{ matrix.environment }} -auto-approve
# from https://github.com/pagopa/opex-dashboard-azure-action/pkgs/container/opex-dashboard-azure-action
docker-version: sha256:e4245954566cd3470e1b5527d33bb58ca132ce7493eac01be9e808fd25a11c8d

0 comments on commit c73a57a

Please sign in to comment.