From 96ad617fe832508494fce877368c3595ec92e3e8 Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Tue, 21 Oct 2025 18:06:46 -0700 Subject: [PATCH 1/5] Add Dev Deploy --- .github/workflows/dev.yaml | 118 +++++++++++++++++++++++++++++++++++ .github/workflows/pages.yaml | 16 ++--- 2 files changed, 126 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/dev.yaml diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml new file mode 100644 index 0000000..373e311 --- /dev/null +++ b/.github/workflows/dev.yaml @@ -0,0 +1,118 @@ +name: "Dev" + +on: + push: + paths: + - ".github/workflows/dev.yaml" + - ".vitepress/**" + - "docs/**" + - "package*.json" + workflow_dispatch: + +env: + SSH_HOST: ${{ secrets.DEV_DEPLOY_HOST }} + SSH_PORT: ${{ secrets.DEV_DEPLOY_PORT }} + SSH_USER: ${{ secrets.DEV_DEPLOY_USER }} + SSH_PASS: ${{ secrets.DEV_DEPLOY_PASS }} + SSH_DEST: /static + +concurrency: + group: dev + cancel-in-progress: false + +jobs: + build: + name: "Build" + runs-on: ubuntu-latest + timeout-minutes: 10 + + permissions: + contents: read + + steps: + - name: "Checkout" + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: "Setup Node 24" + uses: actions/setup-node@v6 + with: + node-version: 24 + + - name: "Install Dependencies" + run: | + npm ci + + - name: "Run Build" + run: | + npm run docs:build + + - name: "Upload Artifact" + uses: actions/upload-artifact@v4 + with: + name: "artifact" + path: .vitepress/dist + + deploy: + name: "Deploy" + runs-on: ubuntu-latest + timeout-minutes: 5 + needs: build + + permissions: + pages: write + id-token: write + + environment: + name: dev + url: https://dev-static.cssnr.com/ + + steps: + - name: "Debug Variables" + continue-on-error: true + run: | + echo "env.SSH_HOST: ${{ env.SSH_HOST }}" + echo "env.SSH_PORT: ${{ env.SSH_PORT }}" + echo "env.SSH_USER: ${{ env.SSH_USER }}" + echo "env.SSH_PASS: ${{ env.SSH_PASS }}" + echo "env.SSH_DEST: ${{ env.SSH_DEST }}" + + - name: "Download Artifact" + uses: actions/download-artifact@v5 + with: + name: "artifact" + + - name: "Debug Artifact" + continue-on-error: true + run: | + cat robots.txt + echo "----------" + tree . + + - name: "Setup SSH" + run: | + mkdir -p "${HOME}/.ssh" + chmod 0700 "${HOME}/.ssh" + ssh-keyscan -p "${{ env.SSH_PORT }}" -H "${{ env.SSH_HOST }}" \ + | tee -a "${HOME}/.ssh/known_hosts" + + - name: "No Rubbits" + run: | + cat < robots.txt + User-agent: * + Disallow: / + EOF + + - name: "Deploy Artifact" + env: + SSHPASS: ${{ env.SSH_PASS }} + run: | + sshpass -e rsync -aPvh --delete -e 'ssh -p ${{ env.SSH_PORT }}' \ + ./ "${{ env.SSH_USER }}"@"${{ env.SSH_HOST }}":"${{ env.SSH_DEST }}" + + - name: "Send Discord Notification" + uses: sarisia/actions-status-discord@v1 + with: + webhook: ${{ secrets.DISCORD_WEBHOOK }} + description: "https://dev-static.cssnr.com/" diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml index a0a2ec3..9c1f374 100644 --- a/.github/workflows/pages.yaml +++ b/.github/workflows/pages.yaml @@ -1,15 +1,15 @@ name: "Pages" on: - push: - branches: - - "master" - paths: - - "docs/**" - - ".vitepress/**" - - "package.json" - - ".github/workflows/pages.yaml" workflow_dispatch: + #push: + # branches: + # - "master" + # paths: + # - "docs/**" + # - ".vitepress/**" + # - "package.json" + # - ".github/workflows/pages.yaml" env: CRAWLER_ID: "7a46f2b7-7169-4936-986d-21391c3134d4" From 27d295a01cea3545641445288c190b9aa5868843 Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Tue, 21 Oct 2025 18:08:15 -0700 Subject: [PATCH 2/5] build --- .github/workflows/dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml index 373e311..a6a6885 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/dev.yaml @@ -46,7 +46,7 @@ jobs: - name: "Run Build" run: | - npm run docs:build + npm run build - name: "Upload Artifact" uses: actions/upload-artifact@v4 From 8efe63cdf4a1ae2af53f67fa06b38ed60f0e5dd8 Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Tue, 21 Oct 2025 18:14:36 -0700 Subject: [PATCH 3/5] Add # nodev --- .github/workflows/dev.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml index a6a6885..a0f3b7a 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/dev.yaml @@ -26,6 +26,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 + if: ${{ !contains(github.event.head_commit.message, '#nodev') }} + permissions: contents: read @@ -86,8 +88,6 @@ jobs: - name: "Debug Artifact" continue-on-error: true run: | - cat robots.txt - echo "----------" tree . - name: "Setup SSH" From fa8b36ce8b58fcc16269bc4bec8e283e07b422fe Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Tue, 21 Oct 2025 18:16:54 -0700 Subject: [PATCH 4/5] Test #nodev --- .github/workflows/dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml index a0f3b7a..a7c7c06 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/dev.yaml @@ -97,7 +97,7 @@ jobs: ssh-keyscan -p "${{ env.SSH_PORT }}" -H "${{ env.SSH_HOST }}" \ | tee -a "${HOME}/.ssh/known_hosts" - - name: "No Rubbits" + - name: "No Robots" run: | cat < robots.txt User-agent: * From 7c0211cf6f3c1e0fb61faf6d6a8082e886e48b38 Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Tue, 21 Oct 2025 18:17:48 -0700 Subject: [PATCH 5/5] Cancel on new job --- .github/workflows/dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml index a7c7c06..7f78b24 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/dev.yaml @@ -18,7 +18,7 @@ env: concurrency: group: dev - cancel-in-progress: false + cancel-in-progress: true jobs: build: