diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index 7d48358c..ad2d5a07 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -5,7 +5,7 @@ on: - master pull_request: env: - NODE_VERSION: 16.15.0 + PNPM_VERSION: 9 jobs: base: runs-on: ubuntu-latest @@ -13,27 +13,21 @@ jobs: size: ${{ steps.size.outputs.size }} if: github.event_name == 'pull_request' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: ref: ${{ github.base_ref }} - - uses: pnpm/action-setup@v2.2.2 + - uses: pnpm/action-setup@v4 with: - version: 7 - - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v2 + version: ${{ env.PNPM_VERSION }} + - uses: actions/setup-node@v2 with: - node-version: ${{ env.NODE_VERSION }} - cache: 'pnpm' - - name: Install dependencies - run: pnpm install - - name: Build - run: pnpm build - - name: Save bundle size - id: size + cache: "pnpm" + - run: pnpm install + - run: pnpm build + - id: size run: | echo "::set-output name=size::$(du -s dist/ | awk '{print $1}')" - - name: Publish result - if: ${{ hashFiles('stats.html') != '' }} + - if: ${{ hashFiles('stats.html') != '' }} run: pnpm dlx surge . https://${{ github.base_ref }}-stats.surge.sh --token ${{ secrets.SURGE_TOKEN }} head: @@ -42,25 +36,19 @@ jobs: size: ${{ steps.size.outputs.size }} if: github.event_name == 'pull_request' steps: - - uses: actions/checkout@v2 - - uses: pnpm/action-setup@v2.2.2 + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 with: - version: 7 - - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v2 + version: ${{ env.PNPM_VERSION }} + - uses: actions/setup-node@v2 with: - node-version: ${{ env.NODE_VERSION }} - cache: 'pnpm' - - name: Install dependencies - run: pnpm install - - name: Build - run: pnpm build - - name: Save bundle size - id: size + cache: "pnpm" + - run: pnpm install + - run: pnpm build + - id: size run: | echo "::set-output name=size::$(du -s dist/ | awk '{print $1}')" - - name: Publish result - if: ${{ hashFiles('stats.html') != '' }} + - if: ${{ hashFiles('stats.html') != '' }} run: pnpm dlx surge . https://${{ github.head_ref }}-stats.surge.sh --token ${{ secrets.SURGE_TOKEN }} compare: @@ -68,15 +56,13 @@ jobs: needs: [base, head] if: github.event_name == 'pull_request' steps: - - name: Find comment - id: fc + - id: fc uses: peter-evans/find-comment@v2 with: issue-number: ${{ github.event.pull_request.number }} - comment-author: 'github-actions[bot]' - body-includes: 'Bundle size comparison' - - name: Create or update comment - uses: peter-evans/create-or-update-comment@v2 + comment-author: "github-actions[bot]" + body-includes: "Bundle size comparison" + - uses: peter-evans/create-or-update-comment@v2 with: comment-id: ${{ steps.fc.outputs.comment-id }} issue-number: ${{ github.event.number }} @@ -85,8 +71,7 @@ jobs: ### Bundle size comparison - Base: [${{needs.base.outputs.size}}](https://${{ github.base_ref }}-stats.surge.sh/stats.html) - Head: [${{needs.head.outputs.size}}](https://${{ github.head_ref }}-stats.surge.sh/stats.html) - - name: Compare bundle sizes - run: | + - run: | if [ "${{needs.base.outputs.size}}" -lt "${{needs.head.outputs.size}}" ]; then exit 1 else @@ -96,25 +81,19 @@ jobs: bundlewatch: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: pnpm/action-setup@v2.2.2 + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 with: - version: 7 - - name: Use Node.js 16.15.0 - uses: actions/setup-node@v2 + version: ${{ env.PNPM_VERSION }} + - uses: actions/setup-node@v2 with: - node-version: 16.15.0 - cache: 'pnpm' - - name: Install dependencies - run: pnpm install - - name: Build - run: pnpm run build - - name: Check bundle size - env: + cache: "pnpm" + - run: pnpm install + - run: pnpm run build + - env: BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }} GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} CI_REPO_OWNER: ${{ github.repository_owner }} - CI_REPO_NAME: taskratchet-web - CI_COMMIT_SHA: ${{ github.sha }} + CI_REPO_CI_COMMIT_SHA: ${{ github.sha }} CI_BRANCH: ${{ github.ref_name }} run: pnpm dlx bundlewatch diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 923f4d46..580047cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: version: ${{ env.PNPM_VERSION }} - uses: actions/setup-node@v4 with: - cache: 'pnpm' + cache: "pnpm" - run: pnpm install - run: pnpm run test audit: @@ -24,7 +24,7 @@ jobs: version: ${{ env.PNPM_VERSION }} - uses: actions/setup-node@v4 with: - cache: 'pnpm' + cache: "pnpm" - run: pnpm install - run: pnpm audit outdated: @@ -36,7 +36,7 @@ jobs: version: ${{ env.PNPM_VERSION }} - uses: actions/setup-node@v4 with: - cache: 'pnpm' + cache: "pnpm" - run: pnpm install - id: outdated run: | @@ -48,8 +48,8 @@ jobs: id: fc with: issue-number: ${{ github.event.pull_request.number }} - comment-author: 'github-actions[bot]' - body-includes: 'Outdated dependencies' + comment-author: "github-actions[bot]" + body-includes: "Outdated dependencies" - uses: peter-evans/create-or-update-comment@v2 with: comment-id: ${{ steps.fc.outputs.comment-id }} @@ -63,10 +63,9 @@ jobs: - uses: pnpm/action-setup@v4 with: version: ${{ env.PNPM_VERSION }} - - name: Use Node.js 16.15.0 - uses: actions/setup-node@v4 + - uses: actions/setup-node@v4 with: - cache: 'pnpm' + cache: "pnpm" - run: pnpm install - run: pnpm dlx depcheck lint: @@ -76,9 +75,9 @@ jobs: - uses: pnpm/action-setup@v4 with: version: ${{ env.PNPM_VERSION }} - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v4 with: - cache: 'pnpm' + cache: "pnpm" - run: pnpm install - run: pnpm run lint prettier: @@ -88,7 +87,7 @@ jobs: - uses: pnpm/action-setup@v4 with: version: ${{ env.PNPM_VERSION }} - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v4 with: - cache: 'pnpm' + cache: "pnpm" - run: pnpm dlx prettier --check . diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index c4e66026..00000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Deploy -on: push -env: - NODE_VERSION: 16.15.0 -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: pnpm/action-setup@v2.2.2 - with: - version: 7 - - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v2 - with: - node-version: ${{ env.NODE_VERSION }} - cache: 'pnpm' - - name: Install dependencies - run: pnpm install - - name: Create env file - run: echo "$DOTENV" > .env - env: - DOTENV: ${{secrets.DOTENV}} - - name: Build - run: pnpm build - - name: Deploy to Netlify - uses: nwtgck/actions-netlify@v1.2 - with: - publish-dir: './dist' - production-branch: master - github-token: ${{ secrets.GITHUB_TOKEN }} - deploy-message: ${{ github.ref_name }} - env: - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - timeout-minutes: 1 diff --git a/.github/workflows/gitguardian.yml b/.github/workflows/gitguardian.yml index 5763fbee..0c2085ce 100644 --- a/.github/workflows/gitguardian.yml +++ b/.github/workflows/gitguardian.yml @@ -1,18 +1,13 @@ -name: GitGuardian scan - on: [push, pull_request] jobs: scanning: - name: GitGuardian scan runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 # fetch all history so multiple commits can be scanned - - name: GitGuardian scan - uses: GitGuardian/ggshield-action@master + - uses: GitGuardian/ggshield-action@master env: GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }} GITHUB_PUSH_BASE_SHA: ${{ github.event.base }} diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml deleted file mode 100644 index c2267ecb..00000000 --- a/.github/workflows/merge.yml +++ /dev/null @@ -1,15 +0,0 @@ -on: - push: - branches: - - 'master' -jobs: - merge: - runs-on: ubuntu-latest - steps: - - name: Post to Beeminder - run: | - curl -X POST https://www.beeminder.com/api/v1/users/${{ secrets.BEEMINDER_USERNAME }}/goals/merge/datapoints.json \ - -d auth_token=${{ secrets.BEEMINDER_AUTH_TOKEN }} \ - -d requestid=${{ github.sha }} \ - -d value=1 \ - -d comment="${{ github.event.head_commit.message }} (${{ github.repository }}:${{ github.sha }})" diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b63383d9..86296655 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -8,16 +8,15 @@ on: jobs: size: - name: Check PR size runs-on: ubuntu-latest steps: - uses: ookami-kb/gh-pr-size-watcher@v1 with: githubToken: ${{ secrets.GITHUB_TOKEN }} errorSize: 500 - errorMessage: ':no_entry: PR has more than **{allowed} additions**. Split it into smaller PRs.' + errorMessage: ":no_entry: PR has more than **{allowed} additions**. Split it into smaller PRs." warningSize: 300 - warningMessage: ':warning: PR has more than **{allowed} additions**. Consider splitting it into smaller PRs.' + warningMessage: ":warning: PR has more than **{allowed} additions**. Consider splitting it into smaller PRs." excludePaths: | pnpm-lock.yaml **/*.spec.ts diff --git a/render.yaml b/render.yaml new file mode 100644 index 00000000..e69de29b