Skip to content

Bump the minor-and-patch-dependencies group with 9 updates (#1669) #708

Bump the minor-and-patch-dependencies group with 9 updates (#1669)

Bump the minor-and-patch-dependencies group with 9 updates (#1669) #708

name: Build, push, and deploy app to dev and prod
on:
push:
branches:
- 'main'
env:
IMAGE: ghcr.io/navikt/familie-ef-soknad:${{ 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"
- name: Npm install
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
run: npm ci
- name: Npm run test
run: npm run test
- name: Npm run build
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_RELEASE: ${{ github.sha }}
run: npm run build
- name: Npm build server
working-directory: ./server
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
run: |
npm ci
npm run build
- name: Build and publish Docker image
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.READER_TOKEN }}
run: |
docker build . -t ${IMAGE}
echo ${GITHUB_TOKEN} | docker login ghcr.io --username ${GITHUB_REPOSITORY} --password-stdin
docker push ${IMAGE}
- name: Post build failures to Slack
if: failure()
run: |
curl -X POST --data "{m\"text\": \"Build av $GITHUB_REPOSITORY feilet - $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\"}" $WEBHOOK_URL
env:
WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
deploy:
name: Deploy to NAIS
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Deploy til dev-gcp
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: nais-dev.yaml
- name: Deploy til prod-gcp
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: prod-gcp
RESOURCE: nais-prod.yaml
- name: Post deploy failures to Slack
if: failure()
run: |
curl -X POST --data "{\"text\": \"Deploy av $GITHUB_REPOSITORY feilet - $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\"}" $WEBHOOK_URL
env:
WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}