This is an automated email from the ASF dual-hosted git repository. zregvart pushed a commit to branch zregvart-patch-1 in repository https://gitbox.apache.org/repos/asf/camel-website.git
The following commit(s) were added to refs/heads/zregvart-patch-1 by this push: new 37d924a fix: don't use filter 37d924a is described below commit 37d924a19ef24c457d2c4ff0d83dfcb5d450612e Author: Zoran Regvart <zregvart+git...@gmail.com> AuthorDate: Sat Mar 2 23:05:00 2019 +0100 fix: don't use filter Put the branch logic for staging/preview in the publish script. --- .github/action-website/publish | 11 +++++------ .github/main.workflow | 28 ++-------------------------- 2 files changed, 7 insertions(+), 32 deletions(-) diff --git a/.github/action-website/publish b/.github/action-website/publish index 0572cf6..21c3f49 100755 --- a/.github/action-website/publish +++ b/.github/action-website/publish @@ -1,20 +1,19 @@ #!/bin/bash +set -euxo pipefail -case "$1" in - staging) +case "$GITHUB_REF" in + "refs/heads/master") DEST_DIR=. ;; - preview) + "refs/pulls/*") DEST_DIR=PR-$(jq .number $GITHUB_EVENT_PATH) ;; *) - echo "Usage: $0 (staging|preview)" + echo "Unmatched ref: $GITHUB_REF" exit 1 esac -set -euxo pipefail - PUBLISH_DIR=$(mktemp -d /tmp/publish.XXXXXXXX) cd $PUBLISH_DIR diff --git a/.github/main.workflow b/.github/main.workflow index 3ec0ad4..25846c6 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -1,9 +1,6 @@ workflow "Build and publish the website" { on = "push" - resolves = [ - "Publish to staging", - "Publish preview", - ] + resolves = ["Publish"] } action "Build theme" { @@ -19,31 +16,10 @@ action "Build website" { args = "--non-interactive --frozen-lockfile" } -action "Filter on master branch" { - uses = "actions/bin/filter@d820d56839906464fb7a57d1b4e1741cf5183efa" - needs = ["Build website"] - args = "branch master" -} - -action "Publish to staging" { +action "Publish" { uses = "./.github/action-website" - needs = ["Filter on master branch"] - runs = "publish" - args = "staging" - secrets = ["GITHUB_TOKEN"] -} - -action "Filter on pull request" { - uses = "actions/bin/filter@d820d56839906464fb7a57d1b4e1741cf5183efa" needs = ["Build website"] - args = "ref refs/pulls/*" -} - -action "Publish preview" { - uses = "./.github/action-website" - needs = ["Filter on pull request"] runs = "publish" - args = "preview" secrets = ["GITHUB_TOKEN"] }