E - Oppdatering av com.google.cloud:google-cloud-storage #517
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
# ****************************************************************************************************************** | |
# | |
# Dette er en auto-generert fil; endringer gjøres i templates/.github/workflows/bygg_mainline_og_deploy.yml | |
# Kjør deretter ' make generate-files' for oppdatering av workflow hos prosjekter | |
# | |
# ****************************************************************************************************************** | |
name: Bygg, deploy DEV, publiser, tag og dispatch deploy til PROD | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
bygg_deploy_dev_publiser_tag: | |
name: 'Bygg, publiser, deploy DEV, tag og dispatch deploy til PROD' | |
permissions: | |
contents: "write" | |
id-token: "write" | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Pull repo' | |
uses: actions/checkout@v3 | |
- name: 'Java' | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 21 | |
distribution: temurin | |
- name: 'Sjekker at bygget kjører' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
export TZ=CET | |
./gradlew build --stacktrace | |
- uses: nais/docker-build-push@v0 | |
id: docker-push | |
with: | |
team: eessipensjon | |
tag: ${{ github.event.repository.name }} | |
pull: true | |
image_suffix: ${{ env.DATE }}${{ env.COMMIT_HASH }} # optional, default empty | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} # required, but is defined as an organization variable | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} # required, but is defined as an organization secret | |
- name: 'Deploy image' | |
run: echo "IMAGE=${{ steps.docker-push.outputs.image }}" | |
- name: 'Deploy to DEV' | |
uses: nais/deploy/actions/deploy@v1 | |
id: docker-build-push # make sure this ID matches the step id below | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: dev-gcp | |
RESOURCE: nais/dev-gcp.yml | |
IMAGE: ${{ steps.docker-push.outputs.image }} | |
TELEMETRY: ${{ steps.docker-build-push.outputs.telemetry }} | |
- name: 'Opprett git tag' | |
run: | | |
curl -v -s -X POST https://api.github.com/repos/${{ github.repository }}/git/refs -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{ "ref": "refs/tags/${{ env.DATE }}---${{ env.COMMIT_HASH }}", "sha": "${{ env.COMMIT_HASH }}" }' | |
- name: 'Dispatch PROD' | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
token: ${{ secrets.DISPATCH_TOKEN }} | |
repository: ${{ github.repository }} | |
event-type: deploy-prod | |
client-payload: '{"image": "${{ steps.docker-push.outputs.image }}"}' | |
- name: 'Echo Image Name' | |
run: echo "### Image Name ${{ steps.docker-push.outputs.image }}" >> $GITHUB_STEP_SUMMARY |