chore: add name field to package.json (#1128) #22
This file contains 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: Build Website | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- website/** | |
pull_request: | |
branches: | |
- main | |
paths: | |
- website/** | |
merge_group: | |
types: | |
- checks_requested | |
paths: | |
- website/** | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: website | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 | |
with: | |
node-version: "20.9" | |
cache: npm | |
cache-dependency-path: website/package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Build website | |
run: npm run build | |
- uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4 | |
if: github.ref == 'refs/heads/main' | |
with: | |
aws-access-key-id: ${{ secrets.WEBSITE_AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.WEBSITE_AWS_SECRET_ACCESS_KEY }} | |
aws-region: eu-central-1 | |
- name: Deploy | |
if: github.ref == 'refs/heads/main' | |
run: >- | |
aws s3 sync build s3://glasskube.dev/ | |
--cache-control "max-age=60, public" | |
--acl=public-read | |
- name: Invalidate cache | |
if: github.ref == 'refs/heads/main' | |
run: >- | |
aws cloudfront create-invalidation | |
--distribution-id EQF3TRPHYDZTB | |
--invalidation-batch "Paths={Quantity='1' ,Items=['/*']},CallerReference=WEBSITE_$GITHUB_RUN_ID" |