Skip to content

Update Deprecated Packs #1921

Update Deprecated Packs

Update Deprecated Packs #1921

Workflow file for this run

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 Pakcs data
runs-on: ubuntu-latest
steps:
- 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@v2'
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@v2'
with:
version: '>= 503.0.0'
- 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.'