-
Notifications
You must be signed in to change notification settings - Fork 13
37 lines (32 loc) · 1.31 KB
/
pages.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
name: Publish to GitHub pages
on:
workflow_call:
jobs:
deploy-to-pages:
name: Deploy to GitHub pages
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Get dist files
uses: actions/cache@v3
with:
path: dist
key: dist-${{ github.event.pull_request.head.sha || github.sha }}
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: dist
target-folder: ${{ github.head_ref || github.ref_name }}
- name: Post demo link comment
uses: actions/github-script@v6
if: github.event_name == 'pull_request_target' && github.event.action == 'opened'
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Your demo site is ready! 🚀 Visit it here: https://${{github.repository_owner}}.github.io/storylines-editor/${{github.head_ref}}`
})