Merge pull request #227 from tanoya/main #442
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: documentation | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
pull_request_target: | |
branches: [main] | |
jobs: | |
checks: | |
# Run workflow pull_request if it is not a fork. | |
# As pull_request_target if it is a fork. | |
if: >- | |
( github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.fork == true ) || | |
( github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false ) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: "refs/pull/${{ github.event.number }}/merge" | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 14 | |
- name: Test Build | |
env: | |
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} | |
run: | | |
if [ -e yarn.lock ]; then | |
yarn install --frozen-lockfile | |
elif [ -e package-lock.json ]; then | |
npm ci | |
else | |
npm i | |
fi | |
npm run crowdin:sync | |
npm run build | |
gh-release: | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 14 | |
- uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }} | |
- name: Release to GitHub Pages | |
env: | |
USE_SSH: true | |
GIT_USER: git | |
DEPLOYMENT_BRANCH: gh-pages | |
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | |
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "nocalhost" | |
if [ -e yarn.lock ]; then | |
yarn install --frozen-lockfile | |
elif [ -e package-lock.json ]; then | |
npm ci | |
else | |
npm i | |
fi | |
npm run crowdin:sync | |
npm run deploy |