From 2f41ae6a4f3ffe0a26244720dd4c6f62b0400a11 Mon Sep 17 00:00:00 2001 From: Kamil Samigullin Date: Tue, 9 May 2023 08:28:58 +0300 Subject: [PATCH] ci/cd: refactor workflows and adopt scripts for new docs structure --- .github/dependabot.yml | 15 +++++++++++++++ .github/workflows/caches.yml | 7 ++++--- .github/workflows/cd.docker.yml | 3 ++- .github/workflows/cd.vercel.yml | 3 ++- .github/workflows/ci.yml | 7 ++++++- .github/workflows/deps.yml | 5 +++-- .github/workflows/docs.yml | 25 +++++++++++++------------ .github/workflows/runs.yml | 5 +++-- .github/workflows/stale.yml | 3 ++- README.md | 2 +- Taskfile | 5 ++--- 11 files changed, 53 insertions(+), 27 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5bc1be59..13ec51b6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -40,6 +40,21 @@ updates: include: 'scope' open-pull-requests-limit: 30 + - package-ecosystem: npm + directory: /docs/ + schedule: + interval: daily + time: '05:00' + timezone: UTC + labels: + - 'type: improvement' + - 'scope: docs' + - 'scope: deps' + commit-message: + prefix: 'docs' + include: 'scope' + open-pull-requests-limit: 30 + - package-ecosystem: npm directory: /tools/ schedule: diff --git a/.github/workflows/caches.yml b/.github/workflows/caches.yml index 1d8c0d4d..ec36444c 100644 --- a/.github/workflows/caches.yml +++ b/.github/workflows/caches.yml @@ -25,7 +25,7 @@ jobs: - name: Install a GitHub CLI cache extension run: gh extension install actions/gh-actions-cache env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ github.token }} - name: Cleanup caches run: | keys=$(gh actions-cache list -L 100 -R '${{ github.repository }}' | cut -f1) @@ -37,7 +37,7 @@ jobs: done echo Done env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ github.token }} notify: name: Notifying @@ -55,9 +55,10 @@ jobs: - name: Send Slack notification uses: rtCamp/action-slack-notify@v2 + continue-on-error: true env: SLACK_COLOR: ${{ contains(needs.*.result, 'failure') && 'failure' || 'success' }} - SLACK_FOOTER: made with ❤️ for everyone, OctoLab + SLACK_FOOTER: made with ❤️ for everyone by OctoLab SLACK_ICON: https://github.com/github.png?size=64 SLACK_MESSAGE: ${{ steps.message.outputs.txt }} SLACK_TITLE: '🧹 ${{ github.repository }}: ${{ github.workflow }}' diff --git a/.github/workflows/cd.docker.yml b/.github/workflows/cd.docker.yml index b55488b6..e382ba36 100644 --- a/.github/workflows/cd.docker.yml +++ b/.github/workflows/cd.docker.yml @@ -85,9 +85,10 @@ jobs: - name: Send Slack notification uses: rtCamp/action-slack-notify@v2 + continue-on-error: true env: SLACK_COLOR: ${{ contains(needs.*.result, 'failure') && 'failure' || 'success' }} - SLACK_FOOTER: made with ❤️ for everyone, OctoLab + SLACK_FOOTER: made with ❤️ for everyone by OctoLab SLACK_ICON: https://github.com/github.png?size=64 SLACK_MESSAGE: ${{ steps.message.outputs.txt }} SLACK_TITLE: '🐳 ${{ github.repository }}: ${{ github.workflow }}' diff --git a/.github/workflows/cd.vercel.yml b/.github/workflows/cd.vercel.yml index 5efbbf2e..b21ceecf 100644 --- a/.github/workflows/cd.vercel.yml +++ b/.github/workflows/cd.vercel.yml @@ -65,9 +65,10 @@ jobs: - name: Send Slack notification uses: rtCamp/action-slack-notify@v2 + continue-on-error: true env: SLACK_COLOR: ${{ contains(needs.*.result, 'failure') && 'failure' || 'success' }} - SLACK_FOOTER: made with ❤️ for everyone, OctoLab + SLACK_FOOTER: made with ❤️ for everyone by OctoLab SLACK_ICON: https://github.com/github.png?size=64 SLACK_MESSAGE: ${{ steps.message.outputs.txt }} SLACK_TITLE: '🚀 ${{ github.repository }}: ${{ github.workflow }}' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a63d0a38..b6d4d037 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,10 @@ on: - '**.tsx?' tags: [ '!*' ] + schedule: + - name: At 07:00 on day-of-month 1, UTC + cron: 0 7 1 * * + jobs: build: name: Building @@ -80,9 +84,10 @@ jobs: - name: Send Slack notification uses: rtCamp/action-slack-notify@v2 + continue-on-error: true env: SLACK_COLOR: ${{ contains(needs.*.result, 'failure') && 'failure' || 'success' }} - SLACK_FOOTER: made with ❤️ for everyone, OctoLab + SLACK_FOOTER: made with ❤️ for everyone by OctoLab SLACK_ICON: https://github.com/github.png?size=64 SLACK_MESSAGE: ${{ steps.message.outputs.txt }} SLACK_TITLE: '⚙️ ${{ github.repository }}: ${{ github.workflow }}' diff --git a/.github/workflows/deps.yml b/.github/workflows/deps.yml index 13ea4394..c0c5a379 100644 --- a/.github/workflows/deps.yml +++ b/.github/workflows/deps.yml @@ -30,7 +30,7 @@ jobs: - name: Emulate dependabot's update process run: | envsubst <.github/integrations/dependabot/job.yml >/tmp/job.yml - dependabot update -f /tmp/job.yml --dry-run + dependabot update -f /tmp/job.yml env: GITHUB_REPOSITORY: ${{ github.repository }} LOCAL_GITHUB_ACCESS_TOKEN: ${{ secrets.DEPENDABOT_TOKEN }} @@ -51,9 +51,10 @@ jobs: - name: Send Slack notification uses: rtCamp/action-slack-notify@v2 + continue-on-error: true env: SLACK_COLOR: ${{ contains(needs.*.result, 'failure') && 'failure' || 'success' }} - SLACK_FOOTER: made with ❤️ for everyone, OctoLab + SLACK_FOOTER: made with ❤️ for everyone by OctoLab SLACK_ICON: https://github.com/github.png?size=64 SLACK_MESSAGE: ${{ steps.message.outputs.txt }} SLACK_TITLE: '🤖 ${{ github.repository }}: ${{ github.workflow }}' diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ae0d575b..b09624a3 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -13,11 +13,12 @@ on: paths: - '.github/workflows/docs.yml' - 'docs/**/*' - - 'tools/pages/**/*' - - 'tools/*.jsx?' - - 'tools/package*.json' tags: [ '!*' ] + schedule: + - name: At 07:00 on day-of-month 1, UTC + cron: 0 7 1 * * + concurrency: group: pages cancel-in-progress: false @@ -37,21 +38,21 @@ jobs: - name: Set up GitHub Pages uses: actions/configure-pages@v3 - - name: Cache tooling dependencies - id: tools + - name: Cache documentation dependencies + id: docs uses: actions/cache@v3 with: - path: ./tools/node_modules - key: tools-${{ hashFiles('tools/package-lock.json') }} - - name: Install tooling dependencies if needed + path: ./docs/node_modules + key: docs-${{ hashFiles('docs/package-lock.json') }} + - name: Install documentation dependencies if needed run: ./Taskfile docs install - if: steps.tools.outputs.cache-hit != 'true' + if: steps.docs.outputs.cache-hit != 'true' - name: Build static HTML with Next.js - run: ./Taskfile docs build publish + run: ./Taskfile docs publish - name: Upload the documentation uses: actions/upload-pages-artifact@v1 - with: { path: docs } + with: { path: docs/dist } deploy: name: Deploying @@ -89,7 +90,7 @@ jobs: continue-on-error: true env: SLACK_COLOR: ${{ contains(needs.*.result, 'failure') && 'failure' || 'success' }} - SLACK_FOOTER: made with ❤️ for everyone, OctoLab + SLACK_FOOTER: made with ❤️ for everyone by OctoLab SLACK_ICON: https://github.com/github.png?size=64 SLACK_MESSAGE: ${{ steps.message.outputs.txt }} SLACK_TITLE: '📚 ${{ github.repository }}: ${{ github.workflow }}' diff --git a/.github/workflows/runs.yml b/.github/workflows/runs.yml index 7be75128..e81c72b7 100644 --- a/.github/workflows/runs.yml +++ b/.github/workflows/runs.yml @@ -9,9 +9,9 @@ on: options: - All - Cache invalidation - - Continuous integration - Continuous delivery (Vercel) - Continuous delivery (Docker) + - Continuous integration - Dependabot at weekends - Documentation delivery - Issue invalidation @@ -63,9 +63,10 @@ jobs: - name: Send Slack notification uses: rtCamp/action-slack-notify@v2 + continue-on-error: true env: SLACK_COLOR: ${{ contains(needs.*.result, 'failure') && 'failure' || 'success' }} - SLACK_FOOTER: made with ❤️ for everyone, OctoLab + SLACK_FOOTER: made with ❤️ for everyone by OctoLab SLACK_ICON: https://github.com/github.png?size=64 SLACK_MESSAGE: ${{ steps.message.outputs.txt }} SLACK_TITLE: '🗑️ ${{ github.repository }}: ${{ github.workflow }}' diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 06f3caa6..43a79c1f 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -68,9 +68,10 @@ jobs: - name: Send Slack notification uses: rtCamp/action-slack-notify@v2 + continue-on-error: true env: SLACK_COLOR: ${{ contains(needs.*.result, 'failure') && 'failure' || 'success' }} - SLACK_FOOTER: made with ❤️ for everyone, OctoLab + SLACK_FOOTER: made with ❤️ for everyone by OctoLab SLACK_ICON: https://github.com/github.png?size=64 SLACK_MESSAGE: ${{ steps.message.outputs.txt }} SLACK_TITLE: '⚠️ ${{ github.repository }}: ${{ github.workflow }}' diff --git a/README.md b/README.md index ec3979be..4726fe69 100644 --- a/README.md +++ b/README.md @@ -175,4 +175,4 @@ See [CLA][] to see the full text. [CLA assistant]: https://cla-assistant.io/tact-app/web [CLA assistant.src]: https://github.com/cla-assistant/cla-assistant -

made with ❤️ for everyone

+

made with ❤️ for everyone by OctoLab

diff --git a/Taskfile b/Taskfile index 0ec1b0ca..51ac9ac1 100755 --- a/Taskfile +++ b/Taskfile @@ -305,7 +305,7 @@ function docs() { # dirty hack related to "docker: open .env: no such file or directory" unset -f npm - pushd tools + pushd docs trap popd EXIT local args=("${@}") @@ -333,9 +333,8 @@ function docs() { ;; publish) - rm -rf ../docs/* + rm -rf dist/ TARGET=static npx --no-install next build - git checkout ../docs/CNAME ../docs/redirects ;; *) break ;;