Skip to content

Commit f5ed7ad

Browse files
committed
Add test workflow
1 parent 9d07e7f commit f5ed7ad

File tree

2 files changed

+43
-2
lines changed

2 files changed

+43
-2
lines changed

.github/workflows/test.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
github-pages:
10+
runs-on: ubuntu-latest
11+
steps:
12+
-
13+
name: Checkout
14+
uses: actions/checkout@master
15+
-
16+
name: Build
17+
run: |
18+
mkdir public
19+
cat > public/index.html <<EOL
20+
<!doctype html>
21+
<html>
22+
<head>
23+
<title>GitHub Pages deployed!</title>
24+
</head>
25+
<body>
26+
<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>
27+
</body>
28+
</html>
29+
EOL
30+
-
31+
name: Deploy
32+
if: success()
33+
uses: crazy-max/ghaction-github-pages@master
34+
with:
35+
target_branch: gh-pages
36+
build_dir: public
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[![GitHub release](https://img.shields.io/github/release/crazy-max/ghaction-github-pages.svg?style=flat-square)](https://github.com/crazy-max/ghaction-github-pages/releases/latest)
2+
[![GitHub marketplace](https://img.shields.io/badge/marketplace-github--pages-blue?logo=github&style=flat-square)](https://github.com/marketplace/actions/github-pages)
3+
[![Test workflow](https://github.com/crazy-max/ghaction-github-pages/workflows/test/badge.svg)](https://github.com/crazy-max/ghaction-github-pages/actions)
14
[![Support me on Patreon](https://img.shields.io/badge/donate-patreon-f96854.svg?logo=patreon&style=flat-square)](https://www.patreon.com/crazymax)
25
[![Paypal Donate](https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal&style=flat-square)](https://www.paypal.me/crazyws)
36

@@ -9,7 +12,7 @@ A GitHub Action for deploying GitHub Pages
912
1013
## 🚀 Usage
1114

12-
Below is a simple to deploy to GitHub Pages:
15+
Below is a simple to deploy to GitHub Pages. A [live example](https://github.com/crazy-max/ghaction-github-pages/actions) is also available for this repository.
1316

1417
```yaml
1518
name: website
@@ -34,7 +37,7 @@ jobs:
3437
<title>GitHub Pages deployed!</title>
3538
</head>
3639
<body>
37-
<p>GitHub Pages with <strong>${{ github.sha }}</strong> commit ID has been deployed through <a href="">GitHub Pages action</a> successfully.</p>
40+
<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>
3841
</body>
3942
</html>
4043
EOL

0 commit comments

Comments
 (0)