Skip to content

Commit 489397e

Browse files
ci: update deploy pr
1 parent d189749 commit 489397e

File tree

1 file changed

+51
-41
lines changed

1 file changed

+51
-41
lines changed

.github/workflows/deploy-pr.yml

Lines changed: 51 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,96 @@
1-
name: 'CI - Pull Request'
1+
name: "CI - Pull Request"
22

33
on:
44
pull_request_target:
55
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
913

1014
concurrency:
11-
group: '${{ github.workflow }}-${{ github.head_ref || github.ref_name }}'
15+
group: "${{ github.workflow }}-${{ github.head_ref || github.ref_name }}"
1216
cancel-in-progress: true
1317

1418
permissions:
1519
contents: read
1620

1721
jobs:
1822
check:
19-
name: 'Check nixos.org PR'
20-
runs-on: 'ubuntu-latest'
23+
name: "Check nixos.org PR"
24+
runs-on: "ubuntu-latest"
2125
permissions:
2226
contents: read
2327
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
2630
with:
2731
ref: ${{ github.event.pull_request.head.sha }}
2832
repository: ${{ github.event.pull_request.head.repo.full_name }}
2933
fetch-depth: 0
3034
persist-credentials: false
3135
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"
3737
run: |
3838
npm install --workspaces --include-workspace-root
39-
40-
- name: 'Check formatting'
39+
- name: "Check formatting"
4140
run: |
4241
npm exec --package=prettier -c 'prettier --check ./core/src'
43-
44-
- name: 'Lint'
42+
- name: "Lint"
4543
run: |
4644
npm exec --package=eslint -c 'eslint'
4745
4846
build:
49-
name: 'Build nixos.org PR'
50-
runs-on: 'ubuntu-latest'
47+
name: "Build nixos.org PR"
48+
runs-on: "ubuntu-latest"
5149
needs: check
5250
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
5652
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
5955
with:
6056
ref: ${{ github.event.pull_request.head.sha }}
6157
repository: ${{ github.event.pull_request.head.repo.full_name }}
6258
fetch-depth: 0
6359
persist-credentials: false
6460
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
6570

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
7787
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 }}"
8090
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"
8494

8595
enable-pull-request-comment: true
8696
overwrites-pull-request-comment: false

0 commit comments

Comments
 (0)