TOKEN TEST #769
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 aksel.dev.nav.no | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- next | |
jobs: | |
build_and_deploy: | |
name: Build and deploy to dev-gcp | |
runs-on: ubuntu-20.04 | |
permissions: | |
packages: "write" | |
contents: "read" | |
id-token: "write" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: yarn | |
- name: set-env for yarn install to @navikt scope | |
shell: bash | |
run: echo "NPM_AUTH_TOKEN=${{ secrets.READER_TOKEN }}" >> $GITHUB_ENV | |
- name: add tokens to .env | |
run: | | |
echo "SLACK_BOT_TOKEN=${{ secrets.SLACK_BOT_TOKEN }}" >> aksel.nav.no/website/.env | |
echo "SANITY_WRITE_KEY=${{ secrets.SANITY_FEEDBACK_WRITE_KEY }}" >> aksel.nav.no/website/.env | |
echo "SANITY_PREVIEW_TOKEN=${{ secrets.SANITY_PREVIEW_TOKEN }}" >> aksel.nav.no/website/.env | |
echo "SANITY_PRIVATE_NO_DRAFTS=${{ secrets.SANITY_PRIVATE_NO_DRAFTS }}" >> aksel.nav.no/website/.env | |
echo "USE_CDN_ASSETS=true" >> aksel.nav.no/website/.env | |
- name: Hide page from search engines | |
run: | | |
echo "User-agent: *\nDisallow: /" > aksel.nav.no/website/public/robots.txt | |
- name: Install dependencies | |
run: yarn | |
- name: Build application | |
run: | | |
yarn boot | |
yarn workspace aksel.nav.no build:next | |
- name: Upload static files to NAV CDN | |
uses: nais/deploy/actions/cdn-upload/v2@master | |
with: | |
team: designsystem | |
source: ./aksel.nav.no/website/.next/static | |
destination: "/website/_next" | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
- name: Get complete tag | |
run: echo "TAG=DEV-$( date +%s )" >> $GITHUB_ENV | |
- uses: nais/docker-build-push@v0 | |
id: docker-push | |
with: | |
team: designsystem | |
push_image: true | |
dockerfile: aksel.nav.no/Dockerfile | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
- name: Deploy to dev-gcp | |
uses: nais/deploy/actions/deploy@master | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
RESOURCE: aksel.nav.no/nais-dev.yaml | |
CLUSTER: dev-gcp | |
IMAGE: ${{ steps.docker-push.outputs.image }} |