|
1 | | -name: 'CI - Pull Request' |
| 1 | +name: "CI - Pull Request" |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | pull_request_target: |
5 | 5 | paths-ignore: |
6 | | - - '**/package.json' |
7 | | - - '**/flake.nix' |
8 | | - - '**/default.nix' |
| 6 | + - "**.nix" |
| 7 | + - "core/i18n/**" |
| 8 | + - "package.json" |
| 9 | + - "package-lock.json" |
| 10 | + - "core/package.json" |
| 11 | + branches: |
| 12 | + - main |
9 | 13 |
|
10 | 14 | concurrency: |
11 | | - group: '${{ github.workflow }}-${{ github.head_ref || github.ref_name }}' |
| 15 | + group: "${{ github.workflow }}-${{ github.head_ref || github.ref_name }}" |
12 | 16 | cancel-in-progress: true |
13 | 17 |
|
14 | 18 | permissions: |
15 | 19 | contents: read |
16 | 20 |
|
17 | 21 | jobs: |
18 | 22 | check: |
19 | | - name: 'Check nixos.org PR' |
20 | | - runs-on: 'ubuntu-latest' |
| 23 | + name: "Check nixos.org PR" |
| 24 | + runs-on: "ubuntu-latest" |
21 | 25 | permissions: |
22 | 26 | contents: read |
23 | 27 | steps: |
24 | | - - name: 'Checking out the PR repository' |
25 | | - uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # v5.0.0 |
| 28 | + - name: "Checking out the PR repository" |
| 29 | + uses: "actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8" # v5.0.0 |
26 | 30 | with: |
27 | 31 | ref: ${{ github.event.pull_request.head.sha }} |
28 | 32 | repository: ${{ github.event.pull_request.head.repo.full_name }} |
29 | 33 | fetch-depth: 0 |
30 | 34 | persist-credentials: false |
31 | 35 | clean: true |
32 | | - |
33 | | - - name: 'Installing Nix' |
34 | | - uses: 'cachix/install-nix-action@7ab6e7fd29da88e74b1e314a4ae9ac6b5cda3801' # v31.8.0 |
35 | | - |
36 | | - - name: 'Install npm dependencies' |
| 36 | + - name: "Install npm dependencies" |
37 | 37 | run: | |
38 | 38 | npm install --workspaces --include-workspace-root |
39 | | -
|
40 | | - - name: 'Check formatting' |
| 39 | + - name: "Check formatting" |
41 | 40 | run: | |
42 | 41 | npm exec --package=prettier -c 'prettier --check ./core/src' |
43 | | -
|
44 | | - - name: 'Lint' |
| 42 | + - name: "Lint" |
45 | 43 | run: | |
46 | 44 | npm exec --package=eslint -c 'eslint' |
47 | 45 |
|
48 | 46 | build: |
49 | | - name: 'Build nixos.org PR' |
50 | | - runs-on: 'ubuntu-latest' |
| 47 | + name: "Build nixos.org PR" |
| 48 | + runs-on: "ubuntu-latest" |
51 | 49 | needs: check |
52 | 50 | permissions: |
53 | | - contents: read # to fetch PR changes |
54 | | - pull-requests: write # to post PR comments |
55 | | - statuses: write # to set commit status |
| 51 | + contents: read |
56 | 52 | steps: |
57 | | - - name: 'Checking out the PR repository' |
58 | | - uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # v5.0.0 |
| 53 | + - name: "Checking out the PR repository" |
| 54 | + uses: "actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8" # v5.0.0 |
59 | 55 | with: |
60 | 56 | ref: ${{ github.event.pull_request.head.sha }} |
61 | 57 | repository: ${{ github.event.pull_request.head.repo.full_name }} |
62 | 58 | fetch-depth: 0 |
63 | 59 | persist-credentials: false |
64 | 60 | clean: true |
| 61 | + - name: "Installing Nix" |
| 62 | + uses: "cachix/install-nix-action@456688f15bc354bef6d396e4a35f4f89d40bf2b7" # v31.8.2 |
| 63 | + - name: "Build" |
| 64 | + run: nix build |
| 65 | + - name: "Upload build artifact" |
| 66 | + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 |
| 67 | + with: |
| 68 | + name: nixos-homepage-artifact |
| 69 | + path: ./result |
65 | 70 |
|
66 | | - - name: 'Installing Nix' |
67 | | - uses: 'cachix/install-nix-action@7ab6e7fd29da88e74b1e314a4ae9ac6b5cda3801' # v31.8.0 |
68 | | - |
69 | | - - name: 'Build' |
70 | | - run: | |
71 | | - nix build |
72 | | - mkdir -p ./build |
73 | | - cp -RL ./result/* ./build/ |
74 | | -
|
75 | | - - name: 'Publish to Netlify' |
76 | | - uses: 'nwtgck/actions-netlify@4cbaf4c08f1a7bfa537d6113472ef4424e4eb654' # v3.0.0 |
| 71 | + publish: |
| 72 | + name: "Publish nixos.org PR" |
| 73 | + runs-on: "ubuntu-latest" |
| 74 | + needs: build |
| 75 | + permissions: |
| 76 | + contents: read # to fetch PR changes |
| 77 | + pull-requests: write # to post PR comments |
| 78 | + statuses: write # to set commit status |
| 79 | + steps: |
| 80 | + - name: "Download build artifact" |
| 81 | + uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 |
| 82 | + with: |
| 83 | + name: nixos-homepage-artifact |
| 84 | + path: ./build |
| 85 | + - name: "Publish to Netlify" |
| 86 | + uses: "nwtgck/actions-netlify@4cbaf4c08f1a7bfa537d6113472ef4424e4eb654" # v3.0.0 |
77 | 87 | env: |
78 | | - NETLIFY_AUTH_TOKEN: '${{ secrets.NETLIFY_AUTH_TOKEN }}' |
79 | | - NETLIFY_SITE_ID: '${{ secrets.NETLIFY_SITE_ID }}' |
| 88 | + NETLIFY_AUTH_TOKEN: "${{ secrets.NETLIFY_AUTH_TOKEN }}" |
| 89 | + NETLIFY_SITE_ID: "${{ secrets.NETLIFY_SITE_ID }}" |
80 | 90 | with: |
81 | | - github-token: '${{ secrets.GITHUB_TOKEN }}' |
82 | | - deploy-message: 'Published from GitHub Actions' |
83 | | - publish-dir: './build' |
| 91 | + github-token: "${{ secrets.GITHUB_TOKEN }}" |
| 92 | + deploy-message: "Published from GitHub Actions" |
| 93 | + publish-dir: "./build" |
84 | 94 |
|
85 | 95 | enable-pull-request-comment: true |
86 | 96 | overwrites-pull-request-comment: false |
|
0 commit comments