Build master & deploy to dev-gcp #20
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 master & deploy to dev-gcp | |
on: | |
workflow_dispatch: | |
env: | |
IMAGE_BASE: ghcr.io/${{ github.repository }} | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # dep submissions | |
id-token: write # nais docker-build-push | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: temurin | |
cache: maven | |
- name: Bygge JAR | |
run: mvn clean package --settings ./.m2/settings.xml | |
env: | |
GITHUB_PASSWORD: ${{ secrets.READER_TOKEN }} | |
- uses: nais/docker-build-push@v0 | |
id: docker-push | |
with: | |
team: k9saksbehandling | |
push_image: true | |
tag: latest | |
pull: true | |
dockerfile: Dockerfile | |
docker_context: . | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
- name: Deploy til preprod | |
uses: nais/deploy/actions/deploy@v2 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: dev-gcp | |
RESOURCE: nais/dev-gcp.yml | |
IMAGE: ${{ steps.docker-push.outputs.image }} | |
- name: Maven Dependency Tree Dependency Submission | |
uses: advanced-security/[email protected] # feil i 4.0.1 | |
with: | |
settings-file: ./.m2/settings.xml | |
ignore-maven-wrapper: true | |
env: | |
GITHUB_USERNAME: x-access-token | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_PASSWORD: ${{ secrets.READER_TOKEN }} |