From 3e519ff8e833c6911e1b5a88d355bfe083e0fc5c Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sat, 18 Jan 2025 11:12:25 -0500 Subject: [PATCH] screw cors --- .github/workflows/cd.yml | 1 + .github/workflows/stars.yml | 13 ++++++++++++- src/components/Stars.tsx | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 51504f81..e5d00dec 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -101,6 +101,7 @@ jobs: --paths $(cat paths-to-invalidate.txt) blog: + if: false name: blog.pkgx.dev runs-on: ubuntu-latest defaults: diff --git a/.github/workflows/stars.yml b/.github/workflows/stars.yml index c787d1be..9058aa6b 100644 --- a/.github/workflows/stars.yml +++ b/.github/workflows/stars.yml @@ -2,6 +2,11 @@ on: schedule: - cron: "17 */2 * * *" workflow_dispatch: + push: + branches: + - main + paths: + - .github/workflows/stars.yml pull_request: paths: - .github/workflows/stars.yml @@ -44,7 +49,7 @@ jobs: echo '${{ steps.fetch.outputs.result }}' > stars.json - aws s3 cp s3://www.pkgx.sh/stars.json ./remote + aws s3 cp s3://www.pkgx.dev/stars.json ./remote if [ "$(cat ./stars.json)" != "$(cat ./remote)" ]; then aws s3 cp ./stars.json s3://www.pkgx.sh/stars.json @@ -52,4 +57,10 @@ jobs: create-invalidation \ --distribution-id E8ZRC36XS5K65 \ --paths /stars.json + + aws s3 cp ./stars.json s3://www.pkgx.dev/stars.json + aws cloudfront \ + create-invalidation \ + --distribution-id E15VQ3SI584CSG \ + --paths /stars.json fi diff --git a/src/components/Stars.tsx b/src/components/Stars.tsx index 25896ffe..eba55fb2 100644 --- a/src/components/Stars.tsx +++ b/src/components/Stars.tsx @@ -7,7 +7,7 @@ export default function Stars({ href, hideCountIfMobile }: { href?: string, hide const isxs = useMediaQuery(theme.breakpoints.down('md')); const {value: stars} = useAsync(async () => { - const response = await fetch('https://pkgx.sh/stars.json'); + const response = await fetch('/stars.json'); const data = await response.json(); return data }, [])