[non-related] ci: test2 #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Github Pages | |
on: | |
push: | |
branches: [ main, opt/ci ] | |
jobs: | |
setup: | |
name: Setup Project Info | |
runs-on: ubuntu-latest | |
outputs: | |
DIST_NAME: ${{ steps.get-info.outputs.DIST_SUFFIX }} | |
steps: | |
- name: 🧐 Checkout | |
id: checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: '0' | |
- name: 📙 Get Build Information | |
id: get-info | |
run: | | |
COMMIT_COUNT=$(git rev-list --count HEAD) | |
BUILD_DATE=$(date "+%y%m%d") | |
HEAD_SHA=$(git rev-parse --short HEAD) | |
echo "DIST_NAME=dist-${COMMIT_COUNT}-${BUILD_DATE}-${HEAD_SHA}" >> $GITHUB_OUTPUT | |
main: | |
name: Deploy to Github Pages | |
needs: setup | |
env: | |
DIST_NAME: ${{ needs.setup.outputs.DIST_NAME }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🧐 Checkout | |
id: checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: '0' | |
- name: 🔨 Build Production Pages | |
id: build | |
uses: ./.github/workflows/build.yml | |
- name: 📦 Download from Artifacts | |
id: download | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.DIST_NAME }} | |
path: dist | |
- name: 🚀 Deploy to Github Pages | |
id: deploy | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: dist | |
branch: gh-pages | |
token: ${{ secrets.DEPLOY_TOKEN }} |