From afb2c8633ea43e1b2053c3ff6fec3fa7301269e5 Mon Sep 17 00:00:00 2001 From: Joah Gerstenberg Date: Tue, 8 Apr 2025 20:56:47 -0500 Subject: [PATCH 1/8] feat: add github action to deploy to pages --- .github/workflows/pages.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/pages.yaml diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml new file mode 100644 index 0000000..25ade83 --- /dev/null +++ b/.github/workflows/pages.yaml @@ -0,0 +1,22 @@ +name: GitHub Pages +on: push +permissions: + contents: write +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install dependencies + run: pnpm i + - name: Build application + run: pnpm build + - name: Remove all files except dist directory + run: find . -maxdepth 1 ! -name 'dist' ! -name '.' -exec rm -rf {} + + - name: Push to gh-pages + run: | + git checkout gh-pages + git config --global user.name 'Robot' + git config --global user.email 'robot@users.noreply.github.com' + git commit -am "Automated report" + git push \ No newline at end of file From b84bf68540890cb0a067bdc0cf4cce59a70e2bd3 Mon Sep 17 00:00:00 2001 From: Joah Gerstenberg Date: Tue, 8 Apr 2025 20:58:15 -0500 Subject: [PATCH 2/8] setup pnpm --- .github/workflows/pages.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml index 25ade83..56e8bc6 100644 --- a/.github/workflows/pages.yaml +++ b/.github/workflows/pages.yaml @@ -7,6 +7,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v4 + with: + version: 10 - name: Install dependencies run: pnpm i - name: Build application From 66408ad52011073e484aab8ea1c2416621af32d3 Mon Sep 17 00:00:00 2001 From: Joah Gerstenberg Date: Tue, 8 Apr 2025 20:59:17 -0500 Subject: [PATCH 3/8] remove version --- .github/workflows/pages.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml index 56e8bc6..2443bf5 100644 --- a/.github/workflows/pages.yaml +++ b/.github/workflows/pages.yaml @@ -8,8 +8,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: pnpm/action-setup@v4 - with: - version: 10 - name: Install dependencies run: pnpm i - name: Build application From d5584655425279417f77ee3af170b5e7d7d208f1 Mon Sep 17 00:00:00 2001 From: Joah Gerstenberg Date: Tue, 8 Apr 2025 21:02:46 -0500 Subject: [PATCH 4/8] fix things --- .github/workflows/pages.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml index 2443bf5..a2cd08e 100644 --- a/.github/workflows/pages.yaml +++ b/.github/workflows/pages.yaml @@ -13,11 +13,12 @@ jobs: - name: Build application run: pnpm build - name: Remove all files except dist directory - run: find . -maxdepth 1 ! -name 'dist' ! -name '.' -exec rm -rf {} + + run: find . -maxdepth 1 ! -name 'dist' ! -name '.git' ! -name '.' -exec rm -rf {} + - name: Push to gh-pages run: | git checkout gh-pages - git config --global user.name 'Robot' - git config --global user.email 'robot@users.noreply.github.com' - git commit -am "Automated report" + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "Release project" git push \ No newline at end of file From 44e06de9c602c2a630f14969338fc531fce9ddfe Mon Sep 17 00:00:00 2001 From: Joah Gerstenberg Date: Tue, 8 Apr 2025 21:10:26 -0500 Subject: [PATCH 5/8] move dist to docs --- .github/workflows/pages.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml index a2cd08e..25fabbf 100644 --- a/.github/workflows/pages.yaml +++ b/.github/workflows/pages.yaml @@ -14,6 +14,8 @@ jobs: run: pnpm build - name: Remove all files except dist directory run: find . -maxdepth 1 ! -name 'dist' ! -name '.git' ! -name '.' -exec rm -rf {} + + - name: Move dist to docs + run: mv dist docs - name: Push to gh-pages run: | git checkout gh-pages From 62195093a02a292a03523e9b92ff6dd652af5375 Mon Sep 17 00:00:00 2001 From: Joah Gerstenberg Date: Tue, 8 Apr 2025 21:16:24 -0500 Subject: [PATCH 6/8] use checkout action --- .github/workflows/pages.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml index 25fabbf..7728da4 100644 --- a/.github/workflows/pages.yaml +++ b/.github/workflows/pages.yaml @@ -16,9 +16,11 @@ jobs: run: find . -maxdepth 1 ! -name 'dist' ! -name '.git' ! -name '.' -exec rm -rf {} + - name: Move dist to docs run: mv dist docs + - uses: actions/checkout@v3 + ref: 'gh-pages' + clean: false - name: Push to gh-pages run: | - git checkout gh-pages git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add . From 27dcad553ebbd064b9e7f3687a21d97ed5d3a7f3 Mon Sep 17 00:00:00 2001 From: Joah Gerstenberg Date: Tue, 8 Apr 2025 21:16:53 -0500 Subject: [PATCH 7/8] fix lint --- .github/workflows/pages.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml index 7728da4..4ad78d4 100644 --- a/.github/workflows/pages.yaml +++ b/.github/workflows/pages.yaml @@ -17,8 +17,9 @@ jobs: - name: Move dist to docs run: mv dist docs - uses: actions/checkout@v3 - ref: 'gh-pages' - clean: false + with: + ref: 'gh-pages' + clean: false - name: Push to gh-pages run: | git config user.name "github-actions[bot]" From 1777ee4ac1aa406185e89911f761021f95fe7b19 Mon Sep 17 00:00:00 2001 From: Joah Gerstenberg Date: Tue, 8 Apr 2025 21:23:23 -0500 Subject: [PATCH 8/8] only run on pushes to main --- .github/workflows/pages.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml index 4ad78d4..42618cc 100644 --- a/.github/workflows/pages.yaml +++ b/.github/workflows/pages.yaml @@ -1,5 +1,8 @@ name: GitHub Pages -on: push +on: + push: + branches: + - main permissions: contents: write jobs: