From 537213e265affc8ccbbe4d908255504d4591cb72 Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Wed, 22 Oct 2025 23:17:03 -0700 Subject: [PATCH 1/6] Updates --- .github/backup/dev.yaml | 108 +++++++++++++++++++++++++++++++ .github/backup/pages.yaml | 122 +++++++++++++++++++++++++++++++++++ .github/workflows/dev.yaml | 105 ++++++------------------------ .github/workflows/pages.yaml | 65 +++++-------------- 4 files changed, 265 insertions(+), 135 deletions(-) create mode 100644 .github/backup/dev.yaml create mode 100644 .github/backup/pages.yaml diff --git a/.github/backup/dev.yaml b/.github/backup/dev.yaml new file mode 100644 index 0000000..81763d0 --- /dev/null +++ b/.github/backup/dev.yaml @@ -0,0 +1,108 @@ +name: "Dev" + +on: + workflow_dispatch: + push: + #branches-ignore: ["master"] + paths: + - ".github/workflows/dev.yaml" + - ".vitepress/**" + - "docs/**" + - "package*.json" + +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: true + +jobs: + build: + name: "Build" + runs-on: ubuntu-latest + timeout-minutes: 10 + + if: ${{ !contains(github.event.head_commit.message, '#nodev') }} + + steps: + - name: "Checkout" + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: "Debug CTX github" + continue-on-error: true + env: + GITHUB_CTX: ${{ toJSON(github) }} + run: echo "$GITHUB_CTX" + + - 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 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 + + environment: + name: dev + url: https://dev-static.cssnr.com/ + + steps: + - name: "Download Artifact" + uses: actions/download-artifact@v5 + with: + name: "artifact" + + - name: "Debug Artifact" + continue-on-error: true + run: | + tree . + + - name: "No Robots" + run: | + cat < robots.txt + User-agent: * + Disallow: / + EOF + + - 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: "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/backup/pages.yaml b/.github/backup/pages.yaml new file mode 100644 index 0000000..e45e952 --- /dev/null +++ b/.github/backup/pages.yaml @@ -0,0 +1,122 @@ +name: "Pages" + +on: + workflow_dispatch: + #push: + # branches: ["master"] + # paths: + # - ".github/workflows/pages.yaml" + # - ".vitepress/**" + # - "docs/**" + # - "package*.json" + +env: + crawler-id: "c294cc15-d908-4f35-a87c-c05e44904c16" + purge-domain: "" + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + name: "Build" + runs-on: ubuntu-latest + timeout-minutes: 10 + + if: ${{ !contains(github.event.head_commit.message, '#nodeploy') }} + + steps: + - name: "Checkout" + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: "Debug CTX github" + continue-on-error: true + env: + GITHUB_CTX: ${{ toJSON(github) }} + run: echo "$GITHUB_CTX" + + - name: "Setup Node 24" + uses: actions/setup-node@v6 + with: + node-version: 24 + + - name: "Configure Pages" + uses: actions/configure-pages@v5 + + - name: "Install Dependencies" + run: | + npm ci + + - name: "Run Build" + run: | + npm run build + + - name: "Upload Pages Artifact" + uses: actions/upload-pages-artifact@v4 + with: + path: .vitepress/dist + + - name: "Send Failure Notification" + if: ${{ failure() }} + uses: sarisia/actions-status-discord@v1 + with: + webhook: ${{ secrets.DISCORD_WEBHOOK }} + + deploy: + name: "Deploy" + runs-on: ubuntu-latest + timeout-minutes: 5 + needs: build + + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: "Deploy Pages" + id: deployment + uses: actions/deploy-pages@v4 + + - name: "Send Deploy Notification" + if: ${{ !cancelled() }} + continue-on-error: true + uses: sarisia/actions-status-discord@v1 + with: + webhook: ${{ secrets.DISCORD_WEBHOOK }} + description: ${{ steps.deployment.outputs.page_url }} + + post: + name: "Post-Deploy" + runs-on: ubuntu-latest + timeout-minutes: 5 + needs: deploy + + steps: + - name: "Purge Cache" + if: ${{ env.purge-domain != '' }} + uses: cssnr/cloudflare-purge-cache-action@v2 + with: + zones: ${{ env.purge-domain }} + token: ${{ secrets.CLOUDFLARE_API_TOKEN }} + + - name: "Algolia Crawler" + if: ${{ env.crawler-id != '' }} + uses: cssnr/algolia-crawler-action@v1 + with: + crawler_id: ${{ env.crawler-id }} + crawler_user_id: ${{ secrets.CRAWLER_USER_ID }} + crawler_api_key: ${{ secrets.CRAWLER_API_KEY }} + + - name: "Send Post-Deploy Notification" + if: ${{ failure() }} + uses: sarisia/actions-status-discord@v1 + with: + webhook: ${{ secrets.DISCORD_WEBHOOK }} + description: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }} diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml index 81763d0..ba86590 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/dev.yaml @@ -3,20 +3,13 @@ name: "Dev" on: workflow_dispatch: push: - #branches-ignore: ["master"] + branches-ignore: [master] paths: - ".github/workflows/dev.yaml" - ".vitepress/**" - "docs/**" - "package*.json" -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: true @@ -24,85 +17,27 @@ concurrency: jobs: build: name: "Build" - runs-on: ubuntu-latest - timeout-minutes: 10 - if: ${{ !contains(github.event.head_commit.message, '#nodev') }} - - steps: - - name: "Checkout" - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - - name: "Debug CTX github" - continue-on-error: true - env: - GITHUB_CTX: ${{ toJSON(github) }} - run: echo "$GITHUB_CTX" - - - 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 build - - - name: "Upload Artifact" - uses: actions/upload-artifact@v4 - with: - name: "artifact" - path: .vitepress/dist + uses: cssnr/workflows/.github/workflows/npm-build.yaml@master + permissions: + contents: read + with: + build: "npm run build" + path: ".vitepress/dist" + secrets: + webhook: ${{ secrets.DISCORD_WEBHOOK }} deploy: name: "Deploy" - runs-on: ubuntu-latest - timeout-minutes: 5 + uses: cssnr/workflows/.github/workflows/deploy-static.yaml@master needs: build - - environment: - name: dev - url: https://dev-static.cssnr.com/ - - steps: - - name: "Download Artifact" - uses: actions/download-artifact@v5 - with: - name: "artifact" - - - name: "Debug Artifact" - continue-on-error: true - run: | - tree . - - - name: "No Robots" - run: | - cat < robots.txt - User-agent: * - Disallow: / - EOF - - - 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: "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/" + permissions: + contents: read + with: + robots: true + secrets: + host: ${{ secrets.DEV_DEPLOY_HOST }} + port: ${{ secrets.DEV_DEPLOY_PORT }} + user: ${{ secrets.DEV_DEPLOY_USER }} + pass: ${{ secrets.DEV_DEPLOY_PASS }} + webhook: ${{ secrets.DISCORD_WEBHOOK }} diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml index e45e952..1c36369 100644 --- a/.github/workflows/pages.yaml +++ b/.github/workflows/pages.yaml @@ -2,13 +2,13 @@ name: "Pages" on: workflow_dispatch: - #push: - # branches: ["master"] - # paths: - # - ".github/workflows/pages.yaml" - # - ".vitepress/**" - # - "docs/**" - # - "package*.json" + push: + branches: [master] + paths: + - ".github/workflows/pages.yaml" + - ".vitepress/**" + - "docs/**" + - "package*.json" env: crawler-id: "c294cc15-d908-4f35-a87c-c05e44904c16" @@ -21,49 +21,14 @@ concurrency: jobs: build: name: "Build" - runs-on: ubuntu-latest - timeout-minutes: 10 - if: ${{ !contains(github.event.head_commit.message, '#nodeploy') }} - - steps: - - name: "Checkout" - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - - name: "Debug CTX github" - continue-on-error: true - env: - GITHUB_CTX: ${{ toJSON(github) }} - run: echo "$GITHUB_CTX" - - - name: "Setup Node 24" - uses: actions/setup-node@v6 - with: - node-version: 24 - - - name: "Configure Pages" - uses: actions/configure-pages@v5 - - - name: "Install Dependencies" - run: | - npm ci - - - name: "Run Build" - run: | - npm run build - - - name: "Upload Pages Artifact" - uses: actions/upload-pages-artifact@v4 - with: - path: .vitepress/dist - - - name: "Send Failure Notification" - if: ${{ failure() }} - uses: sarisia/actions-status-discord@v1 - with: - webhook: ${{ secrets.DISCORD_WEBHOOK }} + uses: cssnr/workflows/.github/workflows/npm-build.yaml@master + permissions: + contents: read + with: + build: "npm run docs:build" + path: ".vitepress/dist" + pages: true deploy: name: "Deploy" @@ -114,7 +79,7 @@ jobs: crawler_user_id: ${{ secrets.CRAWLER_USER_ID }} crawler_api_key: ${{ secrets.CRAWLER_API_KEY }} - - name: "Send Post-Deploy Notification" + - name: "Send Discord Notification" if: ${{ failure() }} uses: sarisia/actions-status-discord@v1 with: From 2316757c873419703c4305a4185eace608ef9389 Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Wed, 22 Oct 2025 23:17:49 -0700 Subject: [PATCH 2/6] Updates --- .github/workflows/pages.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml index 1c36369..81f77a4 100644 --- a/.github/workflows/pages.yaml +++ b/.github/workflows/pages.yaml @@ -26,7 +26,7 @@ jobs: permissions: contents: read with: - build: "npm run docs:build" + build: "npm run build" path: ".vitepress/dist" pages: true From 8705221118a228d52d2ed80c21d8e5048d1487ea Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Wed, 22 Oct 2025 23:22:07 -0700 Subject: [PATCH 3/6] Add LatestVersion.vue --- .vitepress/theme/components/LatestVersion.vue | 105 ++++++++++++++++++ .vitepress/theme/index.js | 2 + docs/guides/get-started.md | 2 +- 3 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 .vitepress/theme/components/LatestVersion.vue diff --git a/.vitepress/theme/components/LatestVersion.vue b/.vitepress/theme/components/LatestVersion.vue new file mode 100644 index 0000000..da5940c --- /dev/null +++ b/.vitepress/theme/components/LatestVersion.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/.vitepress/theme/index.js b/.vitepress/theme/index.js index 2530f7d..cb17eb9 100644 --- a/.vitepress/theme/index.js +++ b/.vitepress/theme/index.js @@ -4,6 +4,7 @@ import 'virtual:group-icons.css' import './custom.css' import StackTable from './components/StackTable.vue' +import LatestVersion from './components/LatestVersion.vue' import CopyButton from '@cssnr/vitepress-plugin-copybutton' import '@cssnr/vitepress-plugin-copybutton/style.css' @@ -21,6 +22,7 @@ export default { enhanceApp({ app }) { app.component('Badge', VPBadge) app.component('StackTable', StackTable) + app.component('LatestVersion', LatestVersion) app.component('CB', CopyButton) app.component('Contributors', Contributors) diff --git a/docs/guides/get-started.md b/docs/guides/get-started.md index b66dbd8..4845844 100644 --- a/docs/guides/get-started.md +++ b/docs/guides/get-started.md @@ -29,7 +29,7 @@ The only 3 required inputs are [token](../docs/inputs.md#token), [url](../docs/i Check out the [Rolling Tags](features.md#rolling-tags) for more tag options, however `@v1` is recommended. -[![Latest Version](https://img.shields.io/github/v/release/cssnr/portainer-stack-deploy-action?style=for-the-badge&logo=github&label=Latest%20Release)](https://github.com/cssnr/portainer-stack-deploy-action/releases) +
From 74746b776471c6b4eaf50c9778890d9a9aece811 Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Wed, 22 Oct 2025 23:26:56 -0700 Subject: [PATCH 4/6] Add Env Defaults --- .github/workflows/dev.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml index ba86590..3415d4d 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/dev.yaml @@ -34,6 +34,8 @@ jobs: permissions: contents: read with: + name: "dev" + url: "https://dev-static.cssnr.com/" robots: true secrets: host: ${{ secrets.DEV_DEPLOY_HOST }} From 6c21c6abd6ec26303f64917f01f0352764408d56 Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Wed, 22 Oct 2025 23:29:18 -0700 Subject: [PATCH 5/6] Remove deleted action --- .vitepress/vars.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vitepress/vars.js b/.vitepress/vars.js index 578cb1f..2079e13 100644 --- a/.vitepress/vars.js +++ b/.vitepress/vars.js @@ -25,7 +25,7 @@ export const repos = [ 'scod-br/portainer-stack-deploy', 'dann41/portainer-stack-deploy', 'ManicMade/portainer-git-stack-redeploy-action', - 'fe5dds9/portainer-deploy-action', + // 'fe5dds9/portainer-deploy-action', 'robin-moser/portainer-stack-deploy', 'SimonPrinz/portainer-deploy-action', 'KevinLamSeck/gh-action-portainer-stack-deploy', From 959deef01871a19b6b4ec1a1a94bdc72d0f214cc Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Wed, 22 Oct 2025 23:30:35 -0700 Subject: [PATCH 6/6] Update list --- .vitepress/vars.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vitepress/vars.js b/.vitepress/vars.js index 2079e13..3d64c1e 100644 --- a/.vitepress/vars.js +++ b/.vitepress/vars.js @@ -20,13 +20,13 @@ export const repos = [ 'sdjnmxd/portainer-stack-deploy', 'AlexPshkov/portainer-stack-deploy', 'Filaind/portainer-stack-deploy', + 'robin-moser/portainer-stack-deploy', 'spawnlab-dev/stack-deploy-action', 'nevcodia/portainer-stack-deployment', 'scod-br/portainer-stack-deploy', 'dann41/portainer-stack-deploy', 'ManicMade/portainer-git-stack-redeploy-action', // 'fe5dds9/portainer-deploy-action', - 'robin-moser/portainer-stack-deploy', 'SimonPrinz/portainer-deploy-action', 'KevinLamSeck/gh-action-portainer-stack-deploy', 'inova-notas/portainer-stack-deploy',