Deploy til dev #189
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: Deploy til dev | |
on: | |
workflow_dispatch: | |
env: | |
IMAGE_BASE: ghcr.io/${{ github.repository }}/${{ github.event.repository.name }} | |
IMAGE: ghcr.io/${{ github.repository }}/${{ github.event.repository.name }}:${{ github.sha }} | |
jobs: | |
bygg: | |
name: Bygg | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
actions: write | |
packages: write | |
steps: | |
- name: Sjekk ut kode | |
uses: actions/checkout@v3 | |
- name: Oppsett Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'maven' | |
- name: Bygg og test med Maven | |
run: mvn -f ./pom.xml clean test package | |
- uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: | | |
${{ env.IMAGE }} | |
${{ env.IMAGE_BASE }}:latest | |
cache-from: type=registry,ref=${{ env.IMAGE_BASE }}:latest | |
cache-to: type=inline | |
deploy-branch: | |
name: Deploy til dev | |
needs: bygg | |
runs-on: ubuntu-latest | |
steps: | |
- name: Sjekk ut kode | |
uses: actions/checkout@v3 | |
- name: Deploy | |
uses: nais/deploy/actions/deploy@v1 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: dev-fss | |
RESOURCE: nais/dev-fss.yaml | |
PRINT_PAYLOAD: true | |
REF: ${{ github.sha }} | |
IMAGE: ${{ env.IMAGE }} | |
VAR: altinn_header=${{ secrets.ALTINN_HEADER_DEV }},apigw_header=${{ secrets.APIGW_HEADER_DEV }} |