diff --git a/.github/workflows/cleanup-stacks.yml b/.github/workflows/cleanup-stacks.yml index efb0e899..b9f30dc3 100644 --- a/.github/workflows/cleanup-stacks.yml +++ b/.github/workflows/cleanup-stacks.yml @@ -2,7 +2,7 @@ name: cleanup-stacks on: schedule: - - cron: '0 0 * * *' + - cron: "0 0 * * *" workflow_dispatch: jobs: @@ -19,9 +19,19 @@ jobs: policies: dev: match: - name: '!production' + name: '!(staging|production)' ttl: hours: 6 + staging: + match: + name: staging + ttl: + hours: 24 + production: + match: + name: production + ttl: + hours: 24 env: PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml index eaf05376..6b67d33e 100644 --- a/.github/workflows/deploy-dev.yml +++ b/.github/workflows/deploy-dev.yml @@ -3,10 +3,9 @@ name: deploy-dev on: workflow_dispatch: -concurrency: ${{ github.head_ref }} +concurrency: ${{ github.head_ref || github.ref_name }} jobs: - build-api: uses: jbrunton/workflows/.github/workflows/build-image.yml@develop with: @@ -22,14 +21,14 @@ jobs: deploy-app: environment: name: Development - url: https://chat-demo-${{ github.head_ref }}.dev.jbrunton-aws.com + url: https://chat-demo-${{ github.head_ref || github.ref_name }}.dev.jbrunton-aws.com needs: [build-api] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Build Client env: - VITE_API_URL: https://chat-demo-api-${{ github.head_ref }}.dev.jbrunton-aws.com + VITE_API_URL: https://chat-demo-api-${{ github.head_ref || github.ref_name }}.dev.jbrunton-aws.com run: | npm ci npm run build @@ -39,7 +38,7 @@ jobs: - uses: pulumi/actions@v3 with: command: up - stack-name: ${{ github.head_ref }} + stack-name: ${{ github.head_ref || github.ref_name }} upsert: true work-dir: pulumi comment-on-pr: true