ghaction-github-pages/.github/workflows/test.yml

44 lines
1003 B
YAML
Raw Normal View History

2019-09-01 06:30:48 +08:00
name: test
on:
push:
branches:
- master
jobs:
github-pages:
runs-on: ubuntu-latest
steps:
-
name: Checkout
2019-10-11 07:51:17 +08:00
uses: actions/checkout@v1
2019-09-01 06:30:48 +08:00
-
name: Build
2020-04-09 06:59:11 +08:00
run: |
npm install
npm run build
-
name: Gen dummy page
2019-09-01 06:30:48 +08:00
run: |
mkdir public
cat > public/index.html <<EOL
<!doctype html>
<html>
<head>
<title>GitHub Pages deployed!</title>
</head>
<body>
<p>GitHub Pages with <strong>${{ github.sha }}</strong> commit ID has been deployed through <a href="https://github.com/marketplace/actions/github-pages">GitHub Pages action</a> successfully.</p>
</body>
</html>
EOL
-
name: Deploy
if: success()
2019-10-11 07:41:16 +08:00
uses: ./
2019-09-01 06:30:48 +08:00
with:
2019-09-01 07:21:12 +08:00
target_branch: test
2019-09-01 06:30:48 +08:00
build_dir: public
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}