fix deploy for GitHub action
This commit is contained in:
@@ -10,16 +10,26 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: false
|
||||
|
||||
- run: corepack enable
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Change content submodule URL
|
||||
run: cd content/ && git remote set-url origin https://github.com/techitwinner/web-content.git && cd ../
|
||||
run: |
|
||||
cd content/
|
||||
git remote set-url origin https://github.com/techitwinner/web-content.git
|
||||
cd ../
|
||||
|
||||
- name: Fetch contents
|
||||
run: git submodule update --init --remote
|
||||
|
||||
- name: Generate static pages
|
||||
run: pnpm generate
|
||||
env:
|
||||
@@ -28,24 +38,29 @@ jobs:
|
||||
NUXT_PUBLIC_BASE_URL: ${{ vars.NUXT_PUBLIC_BASE_URL }}
|
||||
NUXT_PUBLIC_SITE_AUTHOR: ${{ vars.NUXT_PUBLIC_SITE_AUTHOR }}
|
||||
NUXT_PUBLIC_BUILD_BASE_URL: ${{ vars.NUXT_PUBLIC_BUILD_BASE_URL }}
|
||||
- name: Create ZIP artifact
|
||||
run: |
|
||||
zip -r web.zip ./.output/public
|
||||
- name: Upload ZIP artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
|
||||
- name: Upload build output
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
name: web
|
||||
path: web.zip
|
||||
- name: Create GitHub Release
|
||||
id: release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
tag: ${{ github.sha }}
|
||||
name: Release ${{ github.sha }}
|
||||
body: Automated release for commit ${{ github.sha }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
files: web.zip
|
||||
path: .output/public # Nuxt generates static site here
|
||||
# - name: Create ZIP artifact
|
||||
# run: |
|
||||
# zip -r web.zip ./.output/public
|
||||
# - name: Upload ZIP artifact
|
||||
# uses: actions/upload-artifact@v4
|
||||
# with:
|
||||
# name: web
|
||||
# path: web.zip
|
||||
# - name: Create GitHub Release
|
||||
# id: release
|
||||
# uses: ncipollo/release-action@v1
|
||||
# with:
|
||||
# tag: ${{ github.sha }}
|
||||
# name: Release ${{ github.sha }}
|
||||
# body: Automated release for commit ${{ github.sha }}
|
||||
# draft: false
|
||||
# prerelease: false
|
||||
# files: web.zip
|
||||
|
||||
deploy:
|
||||
needs: build
|
||||
|
||||
Reference in New Issue
Block a user