From 7a3689ec9fb16f4624ca5eb5443e2384142fd8e4 Mon Sep 17 00:00:00 2001 From: Thomas Jay Rush Date: Mon, 19 Feb 2024 20:50:25 -0500 Subject: [PATCH] Deployments --- .github/workflows/build-deploy-linkcheck.yaml | 16 ++--- .../build-deploy-linkcheck.yaml.disabled | 72 +++++++++++++++++++ 2 files changed, 76 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/build-deploy-linkcheck.yaml.disabled diff --git a/.github/workflows/build-deploy-linkcheck.yaml b/.github/workflows/build-deploy-linkcheck.yaml index 372ffdbd1..b55dfac9b 100644 --- a/.github/workflows/build-deploy-linkcheck.yaml +++ b/.github/workflows/build-deploy-linkcheck.yaml @@ -51,22 +51,14 @@ jobs: with: switches: -avzr --delete --exclude=".git" --exclude=".github" path: public/ - remote_path: /home/docs/Websites/trueblocks.io - remote_host: ${{ secrets.HOST }} - remote_user: ${{ secrets.HOST_USER }} - remote_key: ${{ secrets.DEPLOY_SSH_KEY }} + remote_path: /home/${{ secrets.DOCS_USER }}/trueblocks-website + remote_host: ${{ secrets.NEW_SERVER_HOST }} + remote_user: ${{ secrets.DOCS_USER }} + remote_key: ${{ secrets.DOCS_PRIVATE_KEY }} - name: check links run: linkinator -r index.html docs/ papers/ data-model/ api/ --skip localhost:23456 --skip tokenomics.io --skip etherscan.io --skip https://twitter.com/trueblocks --skip intro - - name: Test Failure - uses: rjstone/discord-webhook-notify@v1 - if: failure() - with: - severity: error - details: Test Failed! - webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} - - name: Report job status run: | echo "This job's status is ${{ job.status }}" diff --git a/.github/workflows/build-deploy-linkcheck.yaml.disabled b/.github/workflows/build-deploy-linkcheck.yaml.disabled new file mode 100644 index 000000000..372ffdbd1 --- /dev/null +++ b/.github/workflows/build-deploy-linkcheck.yaml.disabled @@ -0,0 +1,72 @@ +name: Sync the website +on: + push: + branches: [main] + workflow_dispatch: +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # we need this because Hugo is configured with enableGitInfo = true + + - uses: actions/setup-node@v2 + with: + node-version: "20" + cache: "npm" + + - name: Install dependencies + run: npm install + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: "0.122.0" + extended: true + + - name: Build Hugo site + run: hugo --minify + + - name: Build API page + uses: seeebiii/redoc-cli-github-action@v10 + with: + args: "bundle --options.disableGoogleFont=true content/api/openapi.yaml -o public/api/index.html" + + - name: Push to deploy branch + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./public + publish_branch: deploy + + - name: Install linkinator + run: npm install -g linkinator + + - name: checkout deploy + run: git checkout -f deploy + + - name: rsync deployments + uses: burnett01/rsync-deployments@5.1 + with: + switches: -avzr --delete --exclude=".git" --exclude=".github" + path: public/ + remote_path: /home/docs/Websites/trueblocks.io + remote_host: ${{ secrets.HOST }} + remote_user: ${{ secrets.HOST_USER }} + remote_key: ${{ secrets.DEPLOY_SSH_KEY }} + + - name: check links + run: linkinator -r index.html docs/ papers/ data-model/ api/ --skip localhost:23456 --skip tokenomics.io --skip etherscan.io --skip https://twitter.com/trueblocks --skip intro + + - name: Test Failure + uses: rjstone/discord-webhook-notify@v1 + if: failure() + with: + severity: error + details: Test Failed! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} + + - name: Report job status + run: | + echo "This job's status is ${{ job.status }}"