Merge pull request #145 from localgod/dependabot/github_actions/actio… #237
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: Main | |
on: | |
push: | |
branches: | |
- master | |
- 'feature/**' | |
- 'releases/**' | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }} | |
- name: Install dependencies | |
run: npm install | |
- name: build | |
run: npm run build_github_pages | |
- name: Save dist | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist/ | |
publish: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: presentation | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Commit files | |
run: | | |
rm -rf assets | |
rm -f index.html | |
- uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: ./ | |
- name: list dir | |
run: ls -la ./ | |
- name: Commit files | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add -A | |
git commit -m "Updated presentation report" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: presentation | |