mirror of
https://github.com/mermaid-js/mermaid-live-editor.git
synced 2025-03-18 17:16:21 +03:00
chore: Use official action to deploy to pages
This commit is contained in:
31
.github/workflows/deploy.yml
vendored
31
.github/workflows/deploy.yml
vendored
@@ -19,6 +19,11 @@ jobs:
|
|||||||
node-version: 18
|
node-version: 18
|
||||||
cache: yarn
|
cache: yarn
|
||||||
|
|
||||||
|
- name: Setup Pages
|
||||||
|
uses: actions/configure-pages@v5
|
||||||
|
with:
|
||||||
|
static_site_generator: sveltekit
|
||||||
|
|
||||||
- name: Build & Deploy
|
- name: Build & Deploy
|
||||||
env:
|
env:
|
||||||
MERMAID_DOMAIN: 'mermaid.live'
|
MERMAID_DOMAIN: 'mermaid.live'
|
||||||
@@ -33,12 +38,24 @@ jobs:
|
|||||||
version=$(yarn version --patch --no-git-tag-version | grep "New version" | cut -d':' -f 2)
|
version=$(yarn version --patch --no-git-tag-version | grep "New version" | cut -d':' -f 2)
|
||||||
yarn build
|
yarn build
|
||||||
yarn run lint
|
yarn run lint
|
||||||
cd ..
|
|
||||||
|
|
||||||
- name: Deploy
|
- name: Upload artifact
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
uses: actions/upload-pages-artifact@v3
|
||||||
if: ${{ github.ref == 'refs/heads/master' }}
|
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
path: ./docs
|
||||||
publish_dir: ./docs
|
|
||||||
keep_files: true
|
deploy:
|
||||||
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
|
||||||
|
permissions:
|
||||||
|
pages: write # to deploy to Pages
|
||||||
|
id-token: write # to verify the deployment originates from an appropriate source
|
||||||
|
steps:
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v4
|
||||||
|
|||||||
Reference in New Issue
Block a user