hxh 4-5 / 2025 #52
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: Publish build | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
publish: | |
environment: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout pages branch | |
uses: actions/checkout@v2 | |
with: | |
ref: pages | |
persist-credentials: false | |
- name: delete current files | |
run: | | |
rm -rf * | |
- name: checkout master branch | |
uses: actions/checkout@v2 | |
with: | |
ref: master | |
path: temp | |
persist-credentials: false | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
cache: 'npm' | |
cache-dependency-path: temp/package-lock.json | |
- name: install && build | |
env: | |
VITE_GANALYTICS_ID: ${{secrets.VITE_GANALYTICS_ID}} | |
VITE_DISQUS_SHORT_NAME: ${{secrets.VITE_DISQUS_SHORT_NAME}} | |
run: | | |
cd temp | |
npm install | |
npm run build | |
- name: move files | |
run: | | |
mv temp/dist/* ./ | |
rm -rf temp | |
- name: commit | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "github-actions" | |
git add . | |
git commit -m "Release build" | |
- name: push | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
force: true | |
branch: pages |