Update Deprecated Packs #3564
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
| # This workflow downloads a JSON file from a Google Cloud Storage bucket that contains the latest data about Packs. | |
| # The file is used by the https://docs.spectrocloud.com/integrations/deprecated-packs/ route path to display the latest information about deprecated Packs. | |
| # The file is generated by automation in the pax-utils repository. | |
| # In the event the deprecated page is removed or the ability to list deprecated packs is improved, then this workflow can be removed. | |
| # This workflow does NOT use the same pack data generated by the pack build plugin located in the plugins/pack-integratios.js file. | |
| # The workflow runs every 6 hours and supports on-demand execution using the workflow_dispatch event. | |
| name: Update Deprecated Packs | |
| on: | |
| schedule: | |
| # Runs at 5 minutes past the hour, every 6 hours. | |
| - cron: "5 */6 * * *" | |
| workflow_dispatch: | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_KEY }} | |
| AWS_DEFAULT_REGION: us-east-1 | |
| jobs: | |
| build: | |
| name: Get Packs data | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 'Set up Node.js 24' # Required for google-github-actions/setup-gcloud@v3 | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| - name: Retrieve Credentials | |
| id: import-secrets | |
| uses: hashicorp/[email protected] | |
| with: | |
| url: https://vault.prism.spectrocloud.com | |
| method: approle | |
| roleId: ${{ secrets.VAULT_ROLE_ID }} | |
| secretId: ${{ secrets.VAULT_SECRET_ID }} | |
| secrets: /providers/github/organizations/spectrocloud/token?org_name=spectrocloud token | VAULT_GITHUB_TOKEN | |
| - uses: 'google-github-actions/auth@v3' | |
| with: | |
| project_id: spectro-common-dev | |
| credentials_json: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} | |
| cleanup_credentials: true | |
| - name: 'Set up Cloud SDK' | |
| uses: 'google-github-actions/setup-gcloud@v3' | |
| with: | |
| version: '>= 503.0.0' | |
| cache: true # v2 -> v3 removes skip_tool_cache; skipping is now the default behavior, so we need to specify to use tool cache | |
| - name: 'Get Packs Data' | |
| run: | | |
| gsutil cp gs://docs-education-automation/packs_inventory/packs_report.json ./packs_report.json | |
| - name: Upload to S3 | |
| run: | | |
| aws s3 cp ./packs_report.json s3://docs.spectrocloud.com/packs-data/ | |
| aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/packs-data/packs_report.json" | |
| aws s3 cp ./packs_report.json s3://docs-latest.spectrocloud.com/packs-data/ | |
| aws cloudfront create-invalidation --distribution-id ${{ secrets.LATEST_DOCS_DISTRIBUTION_ID }} --paths "/packs-data/packs_report.json" | |
| - name: Slack Notification | |
| if: ${{ failure() }} | |
| uses: rtCamp/[email protected] | |
| env: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_PRIVATE_TEAM_WEBHOOK }} | |
| SLACK_USERNAME: "spectromate" | |
| SLACK_ICON_EMOJI: ":robot:" | |
| SLACK_COLOR: ${{ job.status }} | |
| SLACK_MESSAGE: 'The Deprecated Docs cron job that generates the `packs.json` file failed. Please check the logs for more details.' |