Skip to content

Prune preview deploys #218

Prune preview deploys

Prune preview deploys #218

name: Prune preview deploys
on:
schedule:
# run once per day at midnight or whatever
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
id-token: 'write'
env:
CI: 1
PRINT_GITHUB_ANNOTATIONS: 1
defaults:
run:
shell: bash
jobs:
deploy:
name: Prune preview deploys
timeout-minutes: 30
runs-on: ubuntu-latest
environment: deploy-staging
steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- uses: ./.github/actions/setup
- name: Setup Fly IO
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::571248596162:role/huppy-bot
aws-region: 'eu-north-1'
- name: Prune preview deploys
run: yarn tsx internal/scripts/prune-preview-deploys.ts
env:
GH_TOKEN: ${{ github.token }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
NEON_API_KEY: ${{ secrets.NEON_API_KEY }}
NEON_PROJECT_ID: ${{ vars.NEON_PROJECT_ID }}
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}