mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-14 11:15:02 -05:00
48 lines
1.6 KiB
YAML
48 lines
1.6 KiB
YAML
name: Preview Pull Request
|
|
|
|
on:
|
|
pull_request:
|
|
types: [synchronize, reopened, labeled]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
# make sure the pull request is labeled with 'use-preview'
|
|
if: github.event.label.name == 'use-preview' || contains(github.event.pull_request.labels.*.name, 'use-preview')
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
# Head commit of the pull request
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
submodules: recursive
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 15
|
|
cache: "yarn"
|
|
|
|
- run: yarn install
|
|
# - run: yarn check
|
|
|
|
- name: build
|
|
run: yarn build --base "/revite/${{ github.ref }}/"
|
|
|
|
- name: publish preview
|
|
uses: JamesIves/github-pages-deploy-action@4.1.5
|
|
with:
|
|
folder: dist
|
|
branch: build-previews
|
|
target-folder: ${{ github.ref }}
|
|
single-commit: true
|
|
|
|
- name: send comment
|
|
uses: marocchino/sticky-pull-request-comment@v2
|
|
with:
|
|
header: Preview environment
|
|
message: |
|
|
## Preview environment
|
|
https://${{ github.repository_owner }}.github.io/revite/${{ github.ref }}/
|
|
|
|
This link will remain active until the `use-preview` label is removed.
|