commit
ba1ef850a6
2 changed files with 20 additions and 59 deletions
33
.github/workflows/ci.yaml
vendored
33
.github/workflows/ci.yaml
vendored
|
|
@ -1,5 +1,4 @@
|
||||||
name: CI
|
name: ci
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
@ -7,30 +6,16 @@ on:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
ci:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
- uses: pnpm/action-setup@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
- name: Setup PNPM
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
cache: "pnpm"
|
cache: "pnpm"
|
||||||
|
- run: pnpm install
|
||||||
- name: Install dependencies
|
- run: pnpm prettier --check .
|
||||||
run: pnpm install
|
- run: pnpm astro check
|
||||||
|
- run: pnpm build
|
||||||
- name: Prettier check
|
|
||||||
run: pnpm prettier --check .
|
|
||||||
|
|
||||||
- name: Astro check
|
|
||||||
run: pnpm astro check
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: pnpm build
|
|
||||||
|
|
|
||||||
46
.github/workflows/deploy.yaml
vendored
46
.github/workflows/deploy.yaml
vendored
|
|
@ -1,5 +1,4 @@
|
||||||
name: Deploy to AWS S3
|
name: deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows: ["CI"]
|
workflows: ["CI"]
|
||||||
|
|
@ -10,44 +9,21 @@ jobs:
|
||||||
deploy:
|
deploy:
|
||||||
if: >
|
if: >
|
||||||
github.event.workflow_run.conclusion == 'success' &&
|
github.event.workflow_run.conclusion == 'success' &&
|
||||||
github.event.workflow_run.head_branch == 'main'
|
github.event.workflow_run.pull_requests[0].base.ref == 'main'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v3
|
- uses: pnpm/action-setup@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
- name: Setup PNPM
|
|
||||||
uses: pnpm/action-setup@v2
|
|
||||||
with:
|
with:
|
||||||
version: 8
|
node-version: 20
|
||||||
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
cache: "pnpm"
|
cache: "pnpm"
|
||||||
|
- run: pnpm install
|
||||||
- name: Install dependencies
|
- run: pnpm build
|
||||||
run: pnpm install
|
- uses: aws-actions/configure-aws-credentials@v2
|
||||||
|
|
||||||
- name: Build site
|
|
||||||
run: pnpm build
|
|
||||||
|
|
||||||
- name: Configure AWS Credentials
|
|
||||||
uses: aws-actions/configure-aws-credentials@v2
|
|
||||||
with:
|
with:
|
||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
aws-region: us-east-2
|
aws-region: us-east-2
|
||||||
|
- run: chmod +x scripts/deploy.sh && scripts/deploy.sh
|
||||||
- name: Deploy static site to S3 bucket
|
- run: chmod +x scripts/invalidate.sh && scripts/invalidate.sh
|
||||||
run: |
|
|
||||||
chmod +x scripts/deploy.sh
|
|
||||||
scripts/deploy.sh
|
|
||||||
|
|
||||||
- name: Invalidate CloudFront cache
|
|
||||||
env:
|
|
||||||
AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}
|
|
||||||
run: |
|
|
||||||
chmod +x scripts/invalidate.sh
|
|
||||||
scripts/invalidate.sh
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue