mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-23 07:10:41 +00:00
Modernize deployment
This commit is contained in:
36
.github/workflows/deploy.yml
vendored
36
.github/workflows/deploy.yml
vendored
@@ -6,26 +6,40 @@ on:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Get latest version
|
||||
id: get_latest_version
|
||||
run: |
|
||||
echo ::set-output name=data::$(curl -s "https://raw.githubusercontent.com/misode/mcmeta/summary/version.json")
|
||||
- name: 'Get latest version'
|
||||
id: version
|
||||
run: echo "id=$(curl -s https://raw.githubusercontent.com/misode/mcmeta/summary/version.txt)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
npm install
|
||||
export latest_version="'${{ fromJson(steps.get_latest_version.outputs.data).id }}'"
|
||||
export latest_version="'${{ steps.version.outputs.id }}'"
|
||||
npm run build
|
||||
|
||||
- name: Deploy
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v3
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BRANCH: gh-pages
|
||||
FOLDER: dist
|
||||
path: ./dist
|
||||
|
||||
deploy:
|
||||
needs: build
|
||||
|
||||
permissions:
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: actions/deploy-pages@v1
|
||||
id: deployment
|
||||
|
||||
Reference in New Issue
Block a user