From be0cb14ceeb42765f22d40b1ab80f3a3b74551de Mon Sep 17 00:00:00 2001 From: sylvain-morin Date: Mon, 10 Jun 2024 17:12:16 +0200 Subject: [PATCH] Refresh staging deployment --- .github/workflows/CICD-dev.yml | 26 ++++++++++++++++++++++++++ .github/workflows/CICD-main.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/.github/workflows/CICD-dev.yml b/.github/workflows/CICD-dev.yml index 23b70de..bfc5570 100644 --- a/.github/workflows/CICD-dev.yml +++ b/.github/workflows/CICD-dev.yml @@ -46,6 +46,32 @@ jobs: push: true tags: ${{ secrets.DOCKERHUB_USERNAME }}/inatvisionapi-cleanup:${{ github.ref_name }} + refresh-dev-staging-deployment: + name: Refresh Dev Staging Deployment + needs: build-and-push-dev-docker-image + runs-on: ubuntu-20.04 + steps: + - name: Refresh Dev inatvisionapi + uses: actions/github-script@v6 + with: + github-token: ${{secrets.STAGING_DEPLOYMENT_PERSONAL_ACCESS_TOKEN}} + script: |- + await github.rest.actions.createWorkflowDispatch({ + owner: "inaturalist", + repo: "staging-deployment", + workflow_id: "CD-workflow-dispatch.yml", + ref: "main", + inputs: { + "service-type": "vision", + "service-version": "${{ github.ref_name }}" + }, + }).catch(error => error).then(response => { + core.debug(response); + if (response.status !== 204) { + core.setFailed(`create workflow_dispatch received status code ${response.status}`); + } + }); + notify-slack: name: Notify Slack needs: build-and-push-dev-docker-image diff --git a/.github/workflows/CICD-main.yml b/.github/workflows/CICD-main.yml index 6a8a434..f687765 100644 --- a/.github/workflows/CICD-main.yml +++ b/.github/workflows/CICD-main.yml @@ -49,6 +49,32 @@ jobs: ${{ secrets.DOCKERHUB_USERNAME }}/inatvisionapi-cleanup:${{ github.sha }} ${{ secrets.DOCKERHUB_USERNAME }}/inatvisionapi-cleanup:latest + refresh-main-staging-deployment: + name: Refresh Main Staging Deployment + needs: build-and-push-main-docker-image + runs-on: ubuntu-20.04 + steps: + - name: Refresh Main inatvisionapi + uses: actions/github-script@v6 + with: + github-token: ${{secrets.STAGING_DEPLOYMENT_PERSONAL_ACCESS_TOKEN}} + script: |- + await github.rest.actions.createWorkflowDispatch({ + owner: "inaturalist", + repo: "staging-deployment", + workflow_id: "CD-workflow-dispatch.yml", + ref: "main", + inputs: { + "service-type": "vision", + "service-version": "latest" + }, + }).catch(error => error).then(response => { + core.debug(response); + if (response.status !== 204) { + core.setFailed(`create workflow_dispatch received status code ${response.status}`); + } + }); + notify-slack: name: Notify Slack needs: build-and-push-main-docker-image