forked from Discord-Resources-Wiki/Discord-Resources-Wiki
-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (28 loc) · 1 KB
/
preview.yml
File metadata and controls
30 lines (28 loc) · 1 KB
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
name: Preview Build
on: pull_request
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy Preview
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: "18"
- name: Build
run: npm install && npm run build
- name: Publish
id: publish
uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
command: pages publish build --project-name=discord-resources-wiki --branch=pr-${{ github.run_id }} --commit-dirty=true &> output.txt && [[ $(cat output.txt) =~ https://[0-9a-z]+\.[a-z0-9A-Z-]+\.pages\.dev ]] && echo "::set-output name=stdout::$BASH_REMATCH"
- name: Comment PR
if: always()
uses: thollander/actions-comment-pull-request@v1
with:
message: |
Test Deployment:
${{steps.publish.outputs.stdout}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}