From 7fa06ca78d9564676a6425883b1c52fa5c156109 Mon Sep 17 00:00:00 2001 From: abrha Date: Wed, 20 Dec 2023 13:45:08 +0100 Subject: [PATCH] [KAIZEN-0] migrate to Google Artifact Registry --- .github/workflows/main.yaml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c397362d..da5b9020 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -7,7 +7,6 @@ concurrency: cancel-in-progress: true env: - IMAGE: ghcr.io/${{ github.repository }}/internarbeidsflatedecorator:${{ github.sha }} CI: true TZ: Europe/Oslo @@ -35,15 +34,17 @@ jobs: runs-on: ubuntu-latest permissions: packages: write + outputs: + image: ${{ steps.docker-build-push.outputs.image }} steps: - uses: actions/checkout@v3 - name: Publish Docker image - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - docker build --tag ${IMAGE} . - docker login ghcr.io -u ${GITHUB_REPOSITORY} -p ${GITHUB_TOKEN} - docker push ${IMAGE} + uses: nais/docker-build-push@v0 + id: docker-build-push + with: + team: personoversikt + identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} + project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} deploy-qa: name: Deploy to preprod @@ -55,13 +56,13 @@ jobs: q_env: [q0, q1] steps: - uses: actions/checkout@v3 - - uses: nais/deploy/actions/deploy@v1 + - uses: nais/deploy/actions/deploy@v2 env: APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} PRINT_PAYLOAD: true CLUSTER: dev-fss RESOURCE: .nais/qa-template.yaml - VAR: q_env=${{matrix.q_env}} + VAR: q_env=${{matrix.q_env}},image=${{ needs.build-and-push.outputs.image }} deploy-prod: name: Deploy to prod @@ -70,12 +71,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: nais/deploy/actions/deploy@v1 + - uses: nais/deploy/actions/deploy@v2 env: APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} PRINT_PAYLOAD: true CLUSTER: prod-fss RESOURCE: .nais/prod.yaml + VAR: image=${{ needs.build-and-push.outputs.image }} deploy-gh-pages: name: Deploy til gh-pages