chore(pr): add a preview comment on PR if they are previewable
This commit is contained in:
parent
1affcec1de
commit
f878909318
2 changed files with 18 additions and 9 deletions
23
.github/workflows/deploy_pietervdvn.yml
vendored
23
.github/workflows/deploy_pietervdvn.yml
vendored
|
@ -1,6 +1,5 @@
|
|||
name: Deployment on pietervdvn
|
||||
on:
|
||||
push
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
@ -28,13 +27,15 @@ jobs:
|
|||
cd pietervdvn.github.io
|
||||
git pull
|
||||
|
||||
- name: get branch name
|
||||
run: echo TARGET_BRANCH=${GITHUB_REF:11} >> $GITHUB_ENV
|
||||
|
||||
- name: "Copying files"
|
||||
run: |
|
||||
echo "Deploying"
|
||||
TARGET=${GITHUB_REF:11}
|
||||
rm -rf pietervdvn.github.io/mc/$TARGET/*
|
||||
mkdir -p pietervdvn.github.io/mc/$TARGET/
|
||||
cp -r dist/* pietervdvn.github.io/mc/$TARGET/
|
||||
rm -rf pietervdvn.github.io/mc/${{ env.TARGET_BRANCH }}/*
|
||||
mkdir -p pietervdvn.github.io/mc/${{ env.TARGET_BRANCH }}/
|
||||
cp -r dist/* pietervdvn.github.io/mc/${{ env.TARGET_BRANCH }}/
|
||||
cd pietervdvn.github.io/
|
||||
git add *
|
||||
if git status | grep -q "Changes to be committed"
|
||||
|
@ -44,3 +45,13 @@ jobs:
|
|||
else
|
||||
echo "No changes to commit"
|
||||
fi
|
||||
env:
|
||||
TARGET_BRANCH: ${{ env.TARGET_BRANCH }}
|
||||
|
||||
- uses: mshick/add-pr-comment@v1
|
||||
name: Comment the PR with the review URL
|
||||
if: ${{ success() && github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/master' }}
|
||||
with:
|
||||
message: |
|
||||
[🚀 Preview Branch](https://pietervdvn.github.io/mc/${{ env.TARGET_BRANCH }})
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
|
@ -14,7 +14,7 @@ npm run generate:editor-layer-index &&
|
|||
npm run generate &&
|
||||
npm run generate:translations &&
|
||||
npm run test &&
|
||||
npm run generate:layouts
|
||||
npm run generate:layouts
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR - stopping the build"
|
||||
|
@ -28,8 +28,6 @@ cp -r assets/svg/ dist/assets/svg/
|
|||
cp -r assets/tagRenderings/ dist/assets/tagRenderings/
|
||||
cp assets/*.png dist/assets/
|
||||
cp assets/*.svg dist/assets/
|
||||
cp assets/generated/*.png dist/assets/generated/
|
||||
cp assets/generated/*.svg dist/assets/generated/
|
||||
|
||||
SRC_MAPS="--no-source-maps"
|
||||
BRANCH=`git rev-parse --abbrev-ref HEAD`
|
||||
|
|
Loading…
Reference in a new issue