-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
18 additions
and
253 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,76 +4,13 @@ on: | |
branches: | ||
- 'main' | ||
env: | ||
GITHUB_USERNAME: x-access-token | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
build: | ||
build-deploy: | ||
name: "Build and deploy to prod" | ||
permissions: | ||
contents: "read" | ||
contents: "write" | ||
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 -Dmaven.test.skip=true -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: | ||
runs-on: ubuntu-latest | ||
name: Deploy to prod | ||
needs: build | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: deploy | ||
- uses: nais/deploy/actions/deploy@v1 | ||
env: | ||
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | ||
CLUSTER: prod-gcp | ||
RESOURCE: deploy/.nais/nais.yaml | ||
VARS: deploy/.nais/prod.yaml | ||
IMAGE: ${{ needs.build.outputs.image }} | ||
outputs: | ||
image: ${{ needs.build.outputs.image }} | ||
tag: ${{ needs.build.outputs.tag }} | ||
|
||
tag: | ||
runs-on: ubuntu-latest | ||
name: Tag release | ||
permissions: | ||
contents: write | ||
needs: deploy | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Push latest image tag as github tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
custom_tag: ${{ needs.deploy.outputs.tag }} | ||
- name: Create a GitHub release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ steps.tag_version.outputs.new_tag }} | ||
name: Release ${{ steps.tag_version.outputs.new_tag }} | ||
body: ${{ steps.tag_version.outputs.changelog }} | ||
uses: navikt/bidrag-workflow/.github/workflows/release.yaml@main | ||
secrets: inherit |
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
This file was deleted.
Oops, something went wrong.