Update dependency vite to v8.0.9 (#672) #176
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: Deploy | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| id-token: write | |
| contents: write | |
| actions: write | |
| jobs: | |
| bump-version: | |
| name: Bump Version | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.bump-version.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GH_PAT }} | |
| - name: Bump patch version | |
| id: bump-version | |
| run: | | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Action" | |
| # Bump patch version and capture the new version | |
| NEW_VERSION=$(npm version patch --no-git-tag-version | sed 's/^v//') | |
| echo "New version: $NEW_VERSION" | |
| echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT | |
| # Commit the version bump | |
| git add package.json | |
| git commit -m "v$NEW_VERSION [skip ci]" | |
| git push origin main | |
| # Create and push the tag | |
| git tag "v$NEW_VERSION" | |
| git push origin "v$NEW_VERSION" | |
| - name: Send slack notification for new version release | |
| uses: slackapi/slack-github-action@af78098f536edbc4de71162a307590698245be95 # v3.0.1 | |
| with: | |
| webhook: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| webhook-type: incoming-webhook | |
| payload: | | |
| text: "New Traffic Analytics Version Released: v${{ steps.bump-version.outputs.version }}" | |
| blocks: | |
| - type: "section" | |
| text: | |
| type: "mrkdwn" | |
| text: ":tada: *New Traffic Analytics Version Released*" | |
| - type: "section" | |
| fields: | |
| - type: "mrkdwn" | |
| text: "*Version:*\n:label: v${{ steps.bump-version.outputs.version }}" | |
| - type: "mrkdwn" | |
| text: "*Status:*\n:large_green_circle: Released" | |
| - type: "mrkdwn" | |
| text: "*Tag:*\n:bookmark: <${{ github.server_url }}/${{ github.repository }}/releases/tag/v${{ steps.bump-version.outputs.version }}|v${{ steps.bump-version.outputs.version }}>" | |
| - type: "mrkdwn" | |
| text: "*Workflow:*\n:gear: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run>" | |
| attachments: | |
| - color: "good" | |
| fallback: "New Traffic Analytics Version Released: v${{ steps.bump-version.outputs.version }}" | |
| trigger-docker-hub-deploy: | |
| name: Trigger Docker Hub Deploy | |
| runs-on: ubuntu-latest | |
| needs: bump-version | |
| steps: | |
| - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 | |
| with: | |
| script: | | |
| await github.rest.actions.createWorkflowDispatch({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| workflow_id: 'docker-hub.yml', | |
| ref: 'v${{ needs.bump-version.outputs.version }}' | |
| }); | |
| build: | |
| name: Build | |
| needs: bump-version | |
| uses: ./.github/workflows/deploy-image-to-gcp.yml | |
| secrets: inherit | |
| deploy-staging: | |
| name: Deploy Staging | |
| needs: build | |
| uses: ./.github/workflows/deploy-environment.yml | |
| secrets: inherit | |
| with: | |
| environment: staging | |
| image: ${{ needs.build.outputs.version && format('{0}:{1}', vars.DOCKER_IMAGE, needs.build.outputs.version) || '' }} | |
| region: europe-west4 | |
| region_name: netherlands | |
| services: '["analytics", "worker"]' | |
| healthcheck-staging: | |
| name: Healthcheck Staging | |
| needs: deploy-staging | |
| if: needs.deploy-staging.outputs.result == 'success' | |
| uses: ./.github/workflows/run-healthchecks.yml | |
| secrets: inherit | |
| with: | |
| environment: staging | |
| deploy-production: | |
| name: Deploy Production | |
| needs: build | |
| uses: ./.github/workflows/deploy-environment.yml | |
| secrets: inherit | |
| with: | |
| environment: production | |
| image: ${{ needs.build.outputs.version && format('{0}:{1}', vars.DOCKER_IMAGE, needs.build.outputs.version) || '' }} | |
| region: europe-west4 | |
| region_name: netherlands | |
| services: '["analytics", "worker"]' | |
| healthcheck-production: | |
| name: Healthcheck Production | |
| needs: deploy-production | |
| if: needs.deploy-production.outputs.result == 'success' | |
| uses: ./.github/workflows/run-healthchecks.yml | |
| secrets: inherit | |
| with: | |
| environment: production |