add auto-release and artifact upload thingy

This commit is contained in:
2025-10-16 15:55:13 +07:00
committed by GitHub
parent 55954f6d67
commit 22332fe3e4
+21 -11
View File
@@ -1,10 +1,10 @@
# https://github.com/actions/deploy-pages#usage
name: Deploy to GitHub Pages
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
@@ -28,23 +28,33 @@ 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: Upload artifact
uses: actions/upload-pages-artifact@v3
- name: Create ZIP artifact
run: |
zip -r web.zip ./.output/public
- name: Upload ZIP artifact
uses: actions/upload-artifact@v3
with:
path: ./.output/public
# Deployment job
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:
# Add a dependency to the build job
needs: build
# 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
# Deploy to the github_pages environment
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages