Legger til deploy-to-dev action #94
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 feature | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- '**' | |
- '!main' | |
- '!dependabot/**' | |
env: | |
GITHUB_USERNAME: x-access-token | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
build: | |
permissions: | |
contents: "read" | |
id-token: "write" | |
name: Build with maven and docker | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- run: mvn -B -e --settings .m2/maven-settings.xml clean install | |
- uses: nais/docker-build-push@v0 | |
id: docker-push | |
with: | |
team: bidrag | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
outputs: | |
image: ${{ steps.docker-push.outputs.image }} | |
tag: ${{ steps.docker-push.outputs.tag }} | |
deploy-feature: | |
runs-on: ubuntu-latest | |
name: Deploy feature | |
needs: | |
- build | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: deploy | |
- name: Deploy to dev-gcp for feature.yaml | |
uses: nais/deploy/actions/deploy@v1 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: dev-gcp | |
RESOURCE: deploy/.nais/nais.yaml | |
VARS: deploy/.nais/feature.yaml | |
IMAGE: ${{ needs.build.outputs.image }} |