Skip to content

Commit

Permalink
ci: update deploy actions (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz authored Sep 11, 2024
1 parent bbb40c4 commit af47973
Showing 1 changed file with 20 additions and 25 deletions.
45 changes: 20 additions & 25 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,28 @@ jobs:
name: yarn install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install -g yarn
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: yarn
- run: yarn install
- run: yarn build
if: github.ref != 'refs/heads/master'
- run: yarn build
if: github.ref == 'refs/heads/master'
env:
CSS_COMMIT: gh-pages
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@releases/v4
if: github.ref == 'refs/heads/master'
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: public
BASE_BRANCH: master
CLEAN: true
path: public
deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit af47973

Please sign in to comment.