Merge pull request #729 from navikt/oppdater-designsystemet #260
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: Deploy to prod | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
env: | |
CI: true | |
TZ: Europe/Amsterdam | |
jobs: | |
deploy-prod: | |
name: Deploy application to prod | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: npm | |
registry-url: "https://npm.pkg.github.com" | |
- name: Install dependencies | |
run: npm ci | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} | |
- name: Run tests | |
run: npm run test | |
- name: Build application | |
run: npm run build | |
env: | |
PUBLIC_URL: https://veilarbvisittkortfs.intern.nav.no | |
- name: Authenticate to Google Cloud | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: ${{ secrets.GCS_SA_KEY_PROD }} | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v2 | |
- name: Upload files to GCS | |
run: gsutil -m rsync -r build gs://veilarbvisittkortfs-prod | |
- name: Create release | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: Release to prod | |
target_commitish: master | |
tag_name: release/prod@${{ github.sha }} | |
prerelease: false | |
- name: Upload to CDN | |
uses: nais/deploy/actions/cdn-upload/v2@master | |
with: | |
team: poao | |
source: ./build/ | |
destination: /veilarbvisittkortfs-prod/ | |
no_cache_paths: veilarbvisittkortfs-prod/build/asset-manifest.json | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} |