[KAIZEN-0] Skrive om logikk for feature toggles, fjerne toggle for ar… #674
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 | |
on: [push] | |
concurrency: | |
group: main-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
CI: true | |
TZ: Europe/Oslo | |
jobs: | |
build: | |
name: Test and build | |
runs-on: ubuntu-latest | |
if: github.ref != 'refs/heads/dev' && github.ref != 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16.13.1' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Lint and Test | |
run: npm run test | |
- name: Build | |
run: npm run build | |
build-and-push: | |
name: Build and push Docker container | |
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
id-token: write | |
outputs: | |
image: ${{ steps.docker-build-push.outputs.image }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Publish Docker image | |
uses: nais/docker-build-push@v0 | |
id: docker-build-push | |
with: | |
team: personoversikt | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
deploy-qa: | |
name: Deploy to preprod | |
needs: build-and-push | |
if: github.ref == 'refs/heads/dev' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
q_env: [q0, q1] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: nais/deploy/actions/deploy@v2 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
PRINT_PAYLOAD: true | |
CLUSTER: dev-fss | |
RESOURCE: .nais/qa-template.yaml | |
VAR: q_env=${{matrix.q_env}},image=${{ needs.build-and-push.outputs.image }} | |
deploy-prod: | |
name: Deploy to prod | |
needs: build-and-push | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: nais/deploy/actions/deploy@v2 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
PRINT_PAYLOAD: true | |
CLUSTER: prod-fss | |
RESOURCE: .nais/prod.yaml | |
VAR: image=${{ needs.build-and-push.outputs.image }} | |
deploy-gh-pages: | |
name: Deploy til gh-pages | |
needs: build-and-push | |
if: github.ref == 'refs/heads/dev' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16.13.1' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Bundle | |
run: | | |
mv build v2.1 | |
mkdir build | |
mv v2.1 build | |
- name: Deploy gh-pages | |
uses: peaceiris/[email protected] | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PUBLISH_BRANCH: gh-pages | |
PUBLISH_DIR: build |