on-push #33
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: on-push | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '.github/**' | |
permissions: | |
pages: write | |
id-token: write | |
# push | |
contents: write | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_OWNER: ${{ github.repository_owner }} | |
GITHUB_REPO: ${{ github.repository }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: yarn | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
id: yarn-cache | |
with: | |
path: | | |
node_modules | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
if: steps.yarn-cache.outputs.cache-hit != 'true' | |
run: yarn --frozen-lockfile | |
- name: Get issues | |
run: yarn all | |
- name: Build | |
run: yarn build --base /${{ github.event.repository.name }}/ | |
- name: Push to new branch | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add -A | |
git commit -m "bot push" | |
continue-on-error: true | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
branch: issues-page | |
force: true | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/configure-pages@v2 | |
- uses: actions/upload-pages-artifact@v1 | |
with: | |
path: docs/.vitepress/dist | |
deploy: | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
needs: build | |
steps: | |
- id: deployment | |
uses: actions/deploy-pages@v1 |