|
| 1 | +name: Main Workflow |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + pull_request: |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +jobs: |
| 13 | + check: |
| 14 | + name: Check |
| 15 | + runs-on: ubuntu-latest |
| 16 | + permissions: |
| 17 | + contents: read |
| 18 | + steps: |
| 19 | + - name: Harden Runner |
| 20 | + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 |
| 21 | + with: |
| 22 | + egress-policy: audit |
| 23 | + - name: Checkout Repo |
| 24 | + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 |
| 25 | + - name: Setup Node.js |
| 26 | + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 |
| 27 | + with: |
| 28 | + cache: pnpm |
| 29 | + node-version-file: ./package.json |
| 30 | + - name: Install Dependencies |
| 31 | + run: pnpm install --frozen-lockfile |
| 32 | + - name: Lint |
| 33 | + run: pnpm run lint |
| 34 | + |
| 35 | + build: |
| 36 | + name: Build |
| 37 | + needs: |
| 38 | + - check |
| 39 | + runs-on: ubuntu-latest |
| 40 | + permissions: |
| 41 | + contents: read |
| 42 | + steps: |
| 43 | + - name: Harden Runner |
| 44 | + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 |
| 45 | + with: |
| 46 | + egress-policy: audit |
| 47 | + - name: Checkout Repo |
| 48 | + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 |
| 49 | + - name: Setup Node.js |
| 50 | + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 |
| 51 | + with: |
| 52 | + cache: pnpm |
| 53 | + node-version-file: ./package.json |
| 54 | + - name: Install Dependencies |
| 55 | + run: pnpm install --frozen-lockfile |
| 56 | + - name: Build |
| 57 | + run: pnpm run build |
| 58 | + - uses: actions/upload-artifact@84480863f228bb9747b473957fcc9e309aa96097 # v4.4.2 |
| 59 | + with: |
| 60 | + path: | |
| 61 | + build |
| 62 | +
|
| 63 | + release: |
| 64 | + name: Release |
| 65 | + runs-on: ubuntu-latest |
| 66 | + permissions: |
| 67 | + contents: read |
| 68 | + pages: write |
| 69 | + needs: |
| 70 | + - check |
| 71 | + - build |
| 72 | + if: ${{ github.repository == 'ts-graphviz/ts-graphviz.github.io' && github.ref == 'refs/heads/main' && success() }} |
| 73 | + concurrency: |
| 74 | + group: GitHub Pages |
| 75 | + cancel-in-progress: true |
| 76 | + environment: |
| 77 | + name: github-pages |
| 78 | + url: ${{ steps.deployment.outputs.page_url }} |
| 79 | + steps: |
| 80 | + - name: Harden Runner |
| 81 | + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 |
| 82 | + with: |
| 83 | + egress-policy: audit |
| 84 | + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 |
| 85 | + - name: Configure GitHub Pages |
| 86 | + uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 |
| 87 | + - name: Upload GitHub Pages artifact |
| 88 | + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 |
| 89 | + with: |
| 90 | + path: build |
| 91 | + - name: Deploy to GitHub Pages |
| 92 | + id: deployment |
| 93 | + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 |
0 commit comments