chore(deps): bump tar from 7.5.7 to 7.5.9 (#575) #213
This file contains hidden or 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
| name: API CI/CD Main Branch | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| pre-build: | |
| uses: ./.github/workflows/CI-pre-build.yml | |
| build-and-test: | |
| needs: pre-build | |
| uses: ./.github/workflows/CI-build-test.yml | |
| build-and-push-main-docker-image: | |
| name: Build/Push Main Docker Image | |
| needs: pre-build | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Set build date | |
| run: echo "BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV | |
| - name: Build/Push Main inaturalistapi | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: | | |
| ${{ secrets.DOCKERHUB_USERNAME }}/inaturalistapi:${{ github.sha }} | |
| ${{ secrets.DOCKERHUB_USERNAME }}/inaturalistapi:latest | |
| build-args: | | |
| GIT_BRANCH=${{ github.ref_name }} | |
| GIT_COMMIT=${{ github.sha }} | |
| IMAGE_TAG=${{ secrets.DOCKERHUB_USERNAME }}/inaturalistapi:latest | |
| BUILD_DATE=${{ env.BUILD_DATE }} | |
| - name: Build/Push Main inaturalistapi-cleanup | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile-cleanup | |
| push: true | |
| tags: | | |
| ${{ secrets.DOCKERHUB_USERNAME }}/inaturalistapi-cleanup:${{ github.sha }} | |
| ${{ secrets.DOCKERHUB_USERNAME }}/inaturalistapi-cleanup:latest | |
| build-args: | | |
| GIT_BRANCH=${{ github.ref_name }} | |
| GIT_COMMIT=${{ github.sha }} | |
| IMAGE_TAG=${{ secrets.DOCKERHUB_USERNAME }}/inaturalistapi-cleanup:latest | |
| BUILD_DATE=${{ env.BUILD_DATE }} | |
| refresh-main-staging-deployment: | |
| name: Refresh Main Staging Deployment | |
| needs: build-and-push-main-docker-image | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Create GitHub App token | |
| id: app-token | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app-id: ${{ secrets.DEPLOY_APP_ID }} | |
| private-key: ${{ secrets.DEPLOY_APP_PRIVATE_KEY }} | |
| owner: inaturalist | |
| repositories: staging-deployment | |
| - name: Refresh Main inaturalistapi | |
| uses: actions/github-script@v6 | |
| with: | |
| github-token: ${{steps.app-token.outputs.token}} | |
| script: |- | |
| await github.rest.actions.createWorkflowDispatch({ | |
| owner: "inaturalist", | |
| repo: "staging-deployment", | |
| workflow_id: "CD-workflow-dispatch.yml", | |
| ref: "main", | |
| inputs: { | |
| "service-type": "api", | |
| "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 | |
| if: ${{ success() || failure() }} | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: iRoachie/slack-github-actions@v2.3.2 | |
| if: env.SLACK_WEBHOOK_URL != null | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_BUILDS_WEBHOOK_URL }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |