build_application #743
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
# This workflow does: | |
# - 1) Build the website from develop branch & pushes to master branch in the same repository | |
# - 2) Send a trigger to rules repo for updating github pages from this master branch | |
# --- | |
# It runs on every: | |
# - push in develop branch | |
# - incoming repository dispatch event | |
name: build | |
on: | |
repository_dispatch: | |
push: | |
branches: | |
- develop | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '12' | |
check-latest: true | |
- uses: allenevans/set-env@v2.0.1 | |
with: | |
GITHUB_USER_PERSONAL_ACCESS_TOKEN: ${{ secrets.USER_PAT }} | |
- run: | | |
npm install | |
npm run lint | |
npm run build | |
git config user.name "${{ secrets.USER_NAME }}" | |
git config user.email "${{ secrets.USER_EMAIL }}" | |
git checkout -- package-lock.json | |
git fetch | |
git checkout master | |
find . -maxdepth 1 ! -name 'public' ! -name '.git' ! -name '.gitignore' -exec rm -rf {} \; | |
cp -r public/* . | |
rm -R public/ | |
git add -fA | |
git commit --allow-empty -m "chore: update website" | |
git push -u origin master | |
- run: | | |
curl -XPOST -u "${{ secrets.USER_NAME }}:${{ secrets.USER_PAT }}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/act-rules/act-rules.github.io/dispatches --data '{ "event_type": "update_gh_pages" }' |