|
1 | 1 | name: "Master Build, Test & Deploy" |
2 | 2 |
|
| 3 | +permissions: |
| 4 | + contents: read |
| 5 | + |
3 | 6 | on: |
4 | 7 | workflow_dispatch: |
5 | 8 | push: |
6 | 9 | branches: |
7 | | - - master |
| 10 | + - master |
8 | 11 |
|
9 | 12 | jobs: |
10 | 13 | main: |
| 14 | + permissions: |
| 15 | + contents: write |
11 | 16 | runs-on: ubuntu-latest |
12 | 17 | steps: |
13 | | - - uses: actions/checkout@v3 |
14 | | - |
15 | | - - name: Set node version |
16 | | - uses: actions/setup-node@v3 |
17 | | - with: |
18 | | - node-version: '18.x' |
19 | | - |
20 | | - - name: Install |
21 | | - run: | |
22 | | - npm install |
23 | | - npm run setheapsize |
24 | | -
|
25 | | - - name: Lint |
26 | | - run: npx grunt lint |
27 | | - |
28 | | - - name: Unit Tests |
29 | | - run: | |
30 | | - npm test |
31 | | - npm run testnodeconsumer |
32 | | -
|
33 | | - - name: Production Build |
34 | | - if: success() |
35 | | - run: npx grunt prod --msg="Version 10 is here! Read about the new features <a href='https://github.com/gchq/CyberChef/wiki/Character-encoding,-EOL-separators,-and-editor-features'>here</a>" |
36 | | - |
37 | | - - name: Generate sitemap |
38 | | - run: npx grunt exec:sitemap |
39 | | - |
40 | | - - name: UI Tests |
41 | | - if: success() |
42 | | - run: | |
43 | | - sudo apt-get install xvfb |
44 | | - xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui |
45 | | -
|
46 | | - - name: Prepare for GitHub Pages |
47 | | - if: success() |
48 | | - run: npx grunt copy:ghPages |
49 | | - |
50 | | - - name: Deploy to GitHub Pages |
51 | | - if: success() && github.ref == 'refs/heads/master' |
52 | | - uses: crazy-max/ghaction-github-pages@v3 |
53 | | - with: |
54 | | - target_branch: gh-pages |
55 | | - build_dir: ./build/prod |
56 | | - env: |
57 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 18 | + - uses: actions/checkout@v6 |
| 19 | + |
| 20 | + - name: Set node version |
| 21 | + uses: actions/setup-node@v6 |
| 22 | + with: |
| 23 | + node-version: 18 |
| 24 | + registry-url: "https://registry.npmjs.org" |
| 25 | + |
| 26 | + - name: Install |
| 27 | + run: | |
| 28 | + export DETECT_CHROMEDRIVER_VERSION=true |
| 29 | + npm install |
| 30 | + npm run setheapsize |
| 31 | +
|
| 32 | + - name: Lint |
| 33 | + run: npx grunt lint |
| 34 | + |
| 35 | + - name: Unit Tests |
| 36 | + run: | |
| 37 | + npm test |
| 38 | + npm run testnodeconsumer |
| 39 | +
|
| 40 | + - name: Production Build |
| 41 | + if: success() |
| 42 | + run: npx grunt prod --msg="" |
| 43 | + |
| 44 | + - name: Generate sitemap |
| 45 | + run: npx grunt exec:sitemap |
| 46 | + |
| 47 | + - name: UI Tests |
| 48 | + if: success() |
| 49 | + run: | |
| 50 | + sudo apt-get install xvfb |
| 51 | + xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui |
| 52 | +
|
| 53 | + - name: Prepare for GitHub Pages |
| 54 | + if: success() |
| 55 | + run: npx grunt copy:ghPages |
| 56 | + |
| 57 | + - name: Deploy to GitHub Pages |
| 58 | + if: success() && github.ref == 'refs/heads/master' |
| 59 | + uses: crazy-max/ghaction-github-pages@v3 |
| 60 | + with: |
| 61 | + target_branch: gh-pages |
| 62 | + build_dir: ./build/prod |
| 63 | + env: |
| 64 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments