Chore: Gammel datovelger til DatePicker fra Aksel (#1641) #133
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: Build&deploy to prod | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
env: | |
IMAGE: ghcr.io/navikt/familie-tilbake-frontend:${{ github.sha }} | |
IMAGE_LATEST: ghcr.io/navikt/familie-tilbake-frontend:latest | |
VERSION: familie-tilbake-frontend:${{ github.sha }} | |
jobs: | |
build: | |
name: Build and push Docker container | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: npm | |
registry-url: "https://npm.pkg.github.com" | |
- uses: ./.github/yarn-cache | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@3d58c274f17dffee475a5520cbe67f0a882c4dbb | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and publish Docker image | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_RELEASE: ${{ github.sha }} | |
run: | | |
yarn | |
yarn build | |
yarn test | |
docker build . -t ${IMAGE} -t ${IMAGE_LATEST} | |
docker push ${IMAGE} | |
docker push ${IMAGE_LATEST} | |
deploy: | |
name: Deploy to NAIS / GCP | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Deploy til dev-gcp | |
uses: nais/deploy/actions/deploy@v2 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: dev-gcp | |
RESOURCE: build_n_deploy/naiserator/naiserator_dev_gcp.yaml | |
VAR: VERSION=${{ env.VERSION }} | |
- name: Deploy til prod-gcp | |
uses: nais/deploy/actions/deploy@v2 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: prod-gcp | |
RESOURCE: build_n_deploy/naiserator/naiserator_prod_gcp.yaml | |
VAR: VERSION=${{ env.VERSION }} |