This repository has been archived by the owner on Aug 14, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 954
83 lines (67 loc) Β· 2.67 KB
/
pr-preview.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: PR Preview
on:
pull_request_target:
types: [opened, reopened, synchronize]
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.BOT }}
message: |
## Deploying with :page_facing_up: GitHub Pages
| **Commit:** | ${{ github.event.pull_request.head.sha }} |
| :-- | :-- |
| **Status:** | π¨ Building |
| **Deploy Log:** | ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
- uses: actions/checkout@v3
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- uses: actions/setup-node@v3
with:
node-version: 16
- if: ${{ github.event.action == 'opened'}}
run: gh repo create win11bot/${{ github.event.pull_request.number }} --public
env:
GITHUB_TOKEN: ${{ secrets.BOT }}
- name: Install NPM packages
run: npm ci
- name: Get translations
run: npm run crowdin download
env:
api_token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
- name: Build
run: npm run ghbuild
env:
REACT_APP_FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
REACT_APP_FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
- uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.BOT }}
publish_dir: ./build
external_repository: win11bot/${{ github.event.pull_request.number }}
- name: Sleep
run: sleep 1m
shell: bash
- name: Comment
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.BOT }}
message: |
## Deployed with :page_facing_up: GitHub Pages
| **Commit:** | ${{ github.event.pull_request.head.sha }} |
| :-- | :-- |
| **Status:** | β
Success |
| **Preview:** | https://pr-preview.win11react.com/${{ github.event.pull_request.number }} |
| **Deploy Log:** | ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
- if: ${{ failure() }}
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.BOT }}
message: |
## Deploying with :page_facing_up: GitHub Pages
| **Commit:** | ${{ github.event.pull_request.head.sha }} |
| :-- | :-- |
| **Status:** | β Failure |
| **Deploy Log:** | ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |