diff --git a/.github/workflows/build-pull-request.yaml b/.github/workflows/build-pull-request.yaml new file mode 100644 index 00000000..82c1d5ba --- /dev/null +++ b/.github/workflows/build-pull-request.yaml @@ -0,0 +1,15 @@ +on: pull_request + +jobs: + build-pull-request: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-node@v1 + with: + node-version: "16.x" + - run: npm ci + - run: npm test diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index d9e6430e..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: CI -on: - push: - branches: - - main - pull_request: - branches: - - main -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: "16.x" - - run: npm ci - - run: npm test - publish: - if: github.ref == 'refs/heads/main' - needs: test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - uses: actions/setup-node@v1 - with: - node-version: "16.x" - - run: npm ci - - run: npm run build - - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - keep_files: true - user_name: "github-actions[bot]" - user_email: "github-actions[bot]@users.noreply.github.com" diff --git a/.github/workflows/publish-pages.yml b/.github/workflows/publish-pages.yml new file mode 100644 index 00000000..00500532 --- /dev/null +++ b/.github/workflows/publish-pages.yml @@ -0,0 +1,29 @@ +on: + push: + branches: [ main ] + +jobs: + publish-pages: + runs-on: ubuntu-latest + if: github.event.repository.fork == false + + # Required for the `deploy-pages` action + permissions: + pages: write + id-token: write + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-node@v1 + with: + node-version: "16.x" + - run: npm ci + - run: npm run build + - uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa #v3.0.1 + with: + path: "public" + - uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e #v4.0.5 + + diff --git a/.github/workflows/wgutils-automerge.yml b/.github/workflows/wgutils-automerge.yml deleted file mode 100644 index d82b0d3a..00000000 --- a/.github/workflows/wgutils-automerge.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Agenda auto-merge - -on: - pull_request_target: - types: [synchronize, opened, reopened] - -permissions: - contents: write - pull-requests: read - checks: read - -jobs: - validate-and-merge: - if: ${{ github.event.pull_request.base.ref == 'main' }} - runs-on: ubuntu-latest - - steps: - # SECURITY: it's critical we do not check out the source pull request! - - name: Checkout the main branch - uses: actions/checkout@v3 - with: - ref: main - - # We need wgutils to be installed - - run: yarn install - - - name: Wait for checks to pass - env: - GH_TOKEN: ${{ github.token }} - run: | - # Give 15 seconds for any checks to register - sleep 15 - - # Wait for checks to pass - gh pr checks ${{ github.event.pull_request.number }} --fail-fast --watch --required 2>&1 || true - # Now get the result in JSON - CHECKS_OUTPUT="$(gh pr checks ${{ github.event.pull_request.number }} --required --json bucket --jq 'map(.bucket == "pass") | all' 2>&1 || true)" - - if echo "$CHECKS_OUTPUT" | grep -q "no required checks reported"; then - echo "Not required: $CHECKS_OUTPUT" - elif [[ "$CHECKS_OUTPUT" == "true" ]]; then - echo "$CHECKS_OUTPUT" - else - echo "PR state failed? $CHECKS_OUTPUT" - exit 1 - fi - - - name: Automerge if wgutils approves - env: - GH_TOKEN: ${{ github.token }} - run: | - if yarn wgutils can-automerge "${{ github.event.pull_request.number }}" "${{ github.event.pull_request.head.sha }}"; then - gh pr merge "${{ github.event.pull_request.number }}" --squash --auto --match-head-commit "${{ github.event.pull_request.head.sha }}" - fi diff --git a/.gitignore b/.gitignore index 5ac98345..1deceb22 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # Logs +.idea logs *.log npm-debug.log*