r - Sjekker type environment #11
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 publiser for branch RINA CDM | |
on: | |
push: | |
branches: | |
- feature/rina-cdm | |
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 Q1' | |
uses: nais/deploy/actions/deploy@v1 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: dev-gcp | |
RESOURCE: nais/dev-gcp-q1.yml | |
IMAGE: ${{ steps.docker-push.outputs.image }} | |
- 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: 'Echo Image Name' | |
run: echo "### Image Name ${{ steps.docker-push.outputs.image }}" >> $GITHUB_STEP_SUMMARY |