Add test workflow

This commit is contained in:
CrazyMax 2019-09-01 00:30:48 +02:00
parent 9d07e7f3bd
commit f5ed7ad79c
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
2 changed files with 43 additions and 2 deletions

38
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: test
on:
push:
branches:
- master
jobs:
github-pages:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@master
-
name: Build
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()
uses: crazy-max/ghaction-github-pages@master
with:
target_branch: gh-pages
build_dir: public
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,3 +1,6 @@
[![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)
[![GitHub marketplace](https://img.shields.io/badge/marketplace-github--pages-blue?logo=github&style=flat-square)](https://github.com/marketplace/actions/github-pages)
[![Test workflow](https://github.com/crazy-max/ghaction-github-pages/workflows/test/badge.svg)](https://github.com/crazy-max/ghaction-github-pages/actions)
[![Support me on Patreon](https://img.shields.io/badge/donate-patreon-f96854.svg?logo=patreon&style=flat-square)](https://www.patreon.com/crazymax)
[![Paypal Donate](https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal&style=flat-square)](https://www.paypal.me/crazyws)
@ -9,7 +12,7 @@ A GitHub Action for deploying GitHub Pages
## 🚀 Usage
Below is a simple to deploy to GitHub Pages:
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.
```yaml
name: website
@ -34,7 +37,7 @@ jobs:
<title>GitHub Pages deployed!</title>
</head>
<body>
<p>GitHub Pages with <strong>${{ github.sha }}</strong> commit ID has been deployed through <a href="">GitHub Pages action</a> successfully.</p>
<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