feat: hide try it button from billing endpoints #1576
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 Snippets Assets | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| # dumps: | |
| # runs-on: monitoring-all | |
| # environment: production | |
| # steps: | |
| # - name: Dump | |
| # env: | |
| # CDN_PURGE_PAYLOAD: ${{ secrets.SNIPPETS_CDN_PURGE_PAYLOAD }} | |
| # run: | | |
| # printf "%s" "$CDN_PURGE_PAYLOAD" > ~/content.txt | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| environment: production | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| - name: Install pnpm | |
| run: npm install -g pnpm | |
| - name: Install dependencies | |
| working-directory: ./packages/snippets | |
| run: pnpm install | |
| - name: Build project | |
| working-directory: ./packages/snippets | |
| env: | |
| SNIPPETS_CDN_PREFIX: ${{ secrets.SNIPPETS_CDN_PREFIX }} | |
| run: pnpm run build | |
| - name: Configure AWS for MinIO | |
| env: | |
| S3_ACCESS_KEY_ID: ${{ secrets.SNIPPETS_S3_ACCESS_KEY_ID }} | |
| S3_SECRET_ACCESS_KEY: ${{ secrets.SNIPPETS_S3_SECRET_ACCESS_KEY }} | |
| run: | | |
| aws configure set aws_access_key_id "$S3_ACCESS_KEY_ID" | |
| aws configure set aws_secret_access_key "$S3_SECRET_ACCESS_KEY" | |
| aws configure set default.region "us-east-1" | |
| - name: Upload to MinIO S3 using AWS CLI | |
| env: | |
| S3_BUCKET: ${{ secrets.SNIPPETS_S3_BUCKET }} | |
| S3_PREFIX: ${{ secrets.SNIPPETS_S3_PREFIX }} | |
| S3_ENDPOINT: ${{ secrets.SNIPPETS_S3_ENDPOINT }} | |
| run: | | |
| aws --endpoint-url ${S3_ENDPOINT} s3 sync ./packages/snippets/dist s3://${S3_BUCKET}/${S3_PREFIX}/ --delete --exact-timestamps | |
| - name: Trigger Cache Purge | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.SNIPPETS_CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ZONE_ID: ${{ secrets.SNIPPETS_CLOUDFLARE_ZONE_ID }} | |
| CDN_PURGE_PAYLOAD: ${{ secrets.SNIPPETS_CDN_PURGE_PAYLOAD }} | |
| run: | | |
| curl -X POST "https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE_ID/purge_cache" \ | |
| -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ | |
| -H "Content-Type: application/json" \ | |
| --data "$CDN_PURGE_PAYLOAD" |