Skip to content

Commit 6a15f7a

Browse files
committed
Adds the filter example
1 parent aa23d8b commit 6a15f7a

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

+25
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,31 @@ action "Deploy to GitHub Pages" {
3030
}
3131
```
3232

33+
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.
34+
35+
```
36+
workflow "Deploy to Github Pages" {
37+
on = "push"
38+
resolves = ["Deploy to gh-pages"]
39+
}
40+
41+
action "master branch only" {
42+
uses = "actions/bin/filter@master"
43+
args = "branch master"
44+
}
45+
46+
action "Deploy to gh-pages" {
47+
uses = "JamesIves/github-pages-deploy-action@access"
48+
env = {
49+
BRANCH = "gh-pages"
50+
BUILD_SCRIPT = "npm install && npm run-script build"
51+
FOLDER = "build"
52+
}
53+
secrets = ["ACCESS_TOKEN"]
54+
needs = ["master branch only"]
55+
}
56+
```
57+
3358
## Configuration 📁
3459

3560
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.

0 commit comments

Comments
 (0)