| name: Build Website |
| |
| on: |
| push: |
| branches: |
| - master |
| |
| jobs: |
| build: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v3 |
| - uses: actions/setup-node@v3 |
| with: |
| node-version: 16 |
| - name: Install dependencies |
| run: npm ci |
| - name: Build website |
| run: npm run build |
| - name: Deploy to asf-site |
| if: ${{ github.repository_owner == 'apache' && github.event_name != 'pull_request' && github.ref_name == 'master' }} |
| run: | |
| git config --global user.name 'GitHub Actions' |
| git config --global user.email 'dev@royale.apache.org' |
| git fetch |
| git checkout asf-site |
| cp -a _site/. . |
| git add -A |
| git diff-index --quiet HEAD || git commit -m "Deploy site" |
| git push origin asf-site |