Skip to content

Commit

Permalink
Refresh staging deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvain-morin committed Jun 10, 2024
1 parent e1cb0e4 commit be0cb14
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/CICD-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/CICD-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit be0cb14

Please sign in to comment.