Roll back release #5
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: Roll back release | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Version tag (e.g. `v4.5.3`)' | |
required: true | |
type: string | |
jobs: | |
revert: | |
name: Roll back and deploy | |
runs-on: ubuntu-latest | |
environment: prod | |
permissions: | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: app-frontend | |
sparse-checkout: | | |
.github | |
- name: Checkout Altinn-CDN repository | |
uses: actions/checkout@v4 | |
with: | |
repository: 'Altinn/altinn-cdn' | |
token: ${{secrets.ALTINN_CDN_TOKEN}} | |
path: cdn | |
- name: Azure login | |
uses: azure/login@v2 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID_FC }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID_FC }} | |
subscription-id: ${{ secrets.AZURE_CDN_SUBSCRIPTION_ID_FC }} | |
- name: Run roll back script | |
env: | |
FD_DOMAIN: ${{ vars.AZURE_DOMAIN_FC }} | |
FD_ENDPOINT: ${{ vars.AZURE_ENDPOINT_FC }} | |
FD_PROFILE: ${{ vars.AZURE_PROFILE_FC }} | |
FD_RESOURCEGROUP: ${{ vars.AZURE_RESOURCE_GROUP_FC }} | |
run: | | |
bash app-frontend/.github/scripts/revert.sh \ | |
--tag "${{ inputs.tag }}" \ | |
--actor "${{ github.actor }}" \ | |
--actor_id "${{ github.actor_id }}" \ | |
--frontend ./app-frontend \ | |
--cdn ./cdn \ | |
--azure-sa-name "${{ secrets.PRODUCTION_STORAGEACCOUNT_NAME }}" \ | |
--azure-sa-token "${{ secrets.PRODUCTION_ALTINN_CDN_SAS_TOKEN }}" | |
- name: Push to CDN | |
working-directory: cdn | |
run: git push |