Skip to content

v4.9.3

v4.9.3 #161

Workflow file for this run

name: Publish to CDN
on:
release:
types: [published]
jobs:
build:
name: Build and deploy
runs-on: ubuntu-latest
environment: prod
permissions:
id-token: write
steps:
- name: checkout
uses: actions/checkout@v4
with:
path: app-frontend
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: install node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: install dependencies
working-directory: app-frontend
run: yarn --immutable
- name: run build
working-directory: app-frontend
run: yarn build
- 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 release script
working-directory: app-frontend
if: '!github.event.release.prerelease'
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 .github/scripts/release.sh \
--frontend . \
--cdn ../cdn \
--commit \
--azure-sync-cdn \
--azure-sa-name "${{ secrets.PRODUCTION_STORAGEACCOUNT_NAME }}" \
--azure-sa-token "${{ secrets.PRODUCTION_ALTINN_CDN_SAS_TOKEN }}"
- name: Run release script (pre-release)
working-directory: app-frontend
if: 'github.event.release.prerelease'
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 .github/scripts/release.sh \
--frontend . \
--cdn ../cdn \
--commit \
--pre-release \
--azure-sync-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