frontend-CI: use push action #15
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: build frontend | |
on: | |
push: | |
branches: ["development"] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 17.9.1 | |
- name: switch to frontend branch | |
run: | | |
echo switching to branch ${GITHUB_REF_NAME}-frontend | |
git checkout ${GITHUB_REF_NAME}-frontend || git checkout -b ${GITHUB_REF_NAME}-frontend | |
git merge ${GITHUB_REF_NAME}-frontend | |
- name: build frontend | |
run: | | |
cd frontend | |
yarn | |
cd .. | |
./build-frontend.sh | |
- name: config git user | |
run: | | |
curl -s -u ${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }} https://api.github.com/users/${GITHUB_ACTOR} > ${GITHUB_ACTOR}.json | |
git config user.email "$(cat ${GITHUB_ACTOR}.json | jq -r .email)" | |
git config user.name "frontend-bot" | |
- name: commit changes | |
run: | | |
git add -f bad/static/brain* | |
git add -f bad/static/index* | |
git status | |
git commit -m"build frontend" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${GITHUB_REF_NAME}-frontend | |