[HEAD] New article #41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: preview PR | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- closed | |
paths: | |
- source/** | |
- .github/workflows/preview.yml | |
concurrency: preview-${{ github.ref }} | |
jobs: | |
deploy-preview: | |
if: github.repository == 'croque-scp/scp' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install & build projects | |
run: | | |
mkdir dist | |
for project in $(cd source && ls -d */); do | |
pushd source/$project | |
npm install | |
npm run build | |
popd | |
cp -r source/$project/dist dist/$project | |
done | |
- name: Deploy preview | |
uses: rossjrw/pr-preview-action@v1 | |
with: | |
source-dir: dist |