Build, push, and deploy app to dev #1277
Workflow file for this run
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, push, and deploy app to dev | |
on: [ workflow_dispatch ] | |
env: | |
IMAGE: ghcr.io/navikt/familie-ef-sak-frontend:${{ github.sha }} | |
permissions: | |
packages: write | |
id-token: write | |
contents: read | |
jobs: | |
build: | |
name: Build and push Docker container | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: yarn | |
registry-url: "https://npm.pkg.github.com" | |
- name: Yarn install | |
run: yarn --prefer-offline --frozen-lockfile | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} | |
- name: Yarn build | |
run: yarn build | |
- name: Build and publish Docker image | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
docker build . -t ${IMAGE} | |
echo ${GITHUB_TOKEN} | docker login ghcr.io --username ${GITHUB_REPOSITORY} --password-stdin | |
docker push ${IMAGE} | |
deploy: | |
name: Deploy to NAIS | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: nais/deploy/actions/deploy@v2 | |
env: | |
CLUSTER: dev-gcp | |
RESOURCE: build_n_deploy/naiserator/dev.yaml |