Skip to content

update cicd

update cicd #50

Workflow file for this run

name: Deploy
on:
push:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: true # 保留憑證以便後續步驟使用
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Configure Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Install dependencies
run: npm install
- name: Build the project
run: npm run build -- --base-href="/ironman/"
- name: Create .nojekyll file
run: |
mkdir -p dist/ironman # 確保目錄存在
touch dist/ironman/.nojekyll # 創建 .nojekyll 文件
- name: Deploy to GitHub Pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npx angular-cli-ghpages --dir=dist/ironman --repo=https://github.com/${{ github.repository }}.git --no-silent