Adds the filter example

This commit is contained in:
James Ives 2019-03-03 17:04:48 -05:00
parent aa23d8bc72
commit 6a15f7a6ed

View File

@ -30,6 +30,31 @@ action "Deploy to GitHub Pages" {
}
```
If you'd like to filter the action so it only triggers on a specific branch you can combine it with the filter action. You can find an example of this below.
```
workflow "Deploy to Github Pages" {
on = "push"
resolves = ["Deploy to gh-pages"]
}
action "master branch only" {
uses = "actions/bin/filter@master"
args = "branch master"
}
action "Deploy to gh-pages" {
uses = "JamesIves/github-pages-deploy-action@access"
env = {
BRANCH = "gh-pages"
BUILD_SCRIPT = "npm install && npm run-script build"
FOLDER = "build"
}
secrets = ["ACCESS_TOKEN"]
needs = ["master branch only"]
}
```
## Configuration 📁
The `secrets` and `env` portion of the workflow **must** be configured before the action will work. Below you'll find a description of what each one does.