From 57c9cb2e510851597fbf6c1ce39fae43f3bb303a Mon Sep 17 00:00:00 2001 From: Thomas Tykesson Date: Wed, 16 Aug 2023 10:32:33 +0200 Subject: [PATCH] Gjenoppretter autodeploy, og tar i bruk delte jobber --- .github/workflows/auto-deployment.yml | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/auto-deployment.yml diff --git a/.github/workflows/auto-deployment.yml b/.github/workflows/auto-deployment.yml new file mode 100644 index 00000000..eb9fd312 --- /dev/null +++ b/.github/workflows/auto-deployment.yml @@ -0,0 +1,32 @@ +name: Autodeployment +run-name: Autodeploy til prod (hver mandag) +on: + schedule: + - cron: '0 08 * * 1' # kl 09 hver mandag + +jobs: + build-and-test: + name: Test frontend + uses: ./.github/workflows/test.yml + + build-and-push: + name: Build and push Docker container for prod + uses: ./.github/workflows/build-push.yml + with: + environment: prod + secrets: inherit + + deploy-prod: + name: Deploy to prod + needs: [build-and-test, build-and-push] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: nais/deploy/actions/deploy@v1 + env: + APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} + DRY_RUN: false + PRINT_PAYLOAD: true + CLUSTER: prod-gcp + RESOURCE: .nais/nais.yml + VAR: app_version=${{ github.sha }},image=${{ needs.build-and-push.outputs.image }}