Skip to content

Commit

Permalink
refactor: restructured github workflows directories
Browse files Browse the repository at this point in the history
  • Loading branch information
ap0nia committed Jul 10, 2023
1 parent 8ab6548 commit 04c63fc
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 163 deletions.
59 changes: 0 additions & 59 deletions .github/actions/stabilize-stack/action.yml

This file was deleted.

75 changes: 0 additions & 75 deletions .github/workflows/cleanup-pr.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,33 +1,44 @@
---
Creates a preview deployment for the head branch when a PR is made.
---
name: Deploy PR to staging

on:
pull_request:
types:
- opened
- synchronize
- unlabeled

permissions:
id-token: write
contents: read
deployments: write
pull-requests: write

concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true

jobs:
deploy:
if: (!contains(github.event.pull_request.labels.*.name, 'no deploy'))

runs-on: ubuntu-latest

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUM: ${{ github.event.pull_request.number }}
NODE_ENV: staging

ACCOUNT_ID: ${{ secrets.ACCOUNT_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_REGION: us-east-1
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1

CERTIFICATE_ARN: ${{ secrets.CERTIFICATE_ARN }}
DATABASE_URL: ${{ secrets.DATABASE_URL_STAGING }}
HOSTED_ZONE_ID: ${{ secrets.HOSTED_ZONE_ID }}
NODE_ENV: staging
PR_NUM: ${{ github.event.pull_request.number }}

steps:
- name: Check out codebase
Expand Down Expand Up @@ -57,30 +68,5 @@ jobs:
- name: Build assets
run: pnpm build

- name: Wait for API stack to stabilize
uses: ./.github/actions/stabilize-stack
with:
stack_name: peterportal-api-next-staging-${{ github.event.pull_request.number }}
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRETS_ACCESS_KEY }}

- name: Wait for docs stack to stabilize
uses: ./.github/actions/stabilize-stack
with:
stack_name: peterportal-api-next-docs-staging-${{ github.event.pull_request.number }}
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRETS_ACCESS_KEY }}

- name: Deploy stacks
run: pnpm run deploy --filter="ant-stack" --filter="docs-cdk"

- name: Comment staging URLs
uses: marocchino/sticky-pull-request-comment@v2
with:
header: stagingURL
recreate: true
message: 🚀 Staging instances deployed!

API - https://staging-${{ github.event.pull_request.number }}.api-next.peterportal.org

Docs - https://staging-${{ github.event.pull_request.number }}-docs.api-next.peterportal.org
run: pnpm ant-stack deploy
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
A utility workflow to synchronize the `.github/labels.yml` manifest with the repository's currently available labels.

[Read More](https://github.com/micnncim/action-label-syncer)
---
name: Sync labels
on:
push:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
Ensure that pull request titles are up to Los Pollos standards.
---
name: Lint PR title and message

on:
pull_request_target:

jobs:
lint-pr:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
Verify that code satisfies TypeScript checks.
---
name: Check for TypeScript errors

on:
pull_request:

jobs:
check-typescript:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 04c63fc

Please sign in to comment.