next -> next #636
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/setup-node@v3 | |
with: | |
node-version: "20" | |
- uses: actions/checkout@v3 | |
- name: add tokens to .env | |
run: | | |
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: Restore cache | |
uses: actions/cache@v3 | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-dev-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-dev- | |
- 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: navikt/frontend/actions/cdn-upload/v1@main | |
with: | |
cdn-team-name: aksel | |
source: ./aksel.nav.no/website/.next/static | |
destination: "/website/_next" | |
- 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 }} |