This is an automated email from the ASF dual-hosted git repository.

zregvart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 6449b0b  chore: try to publish to asf-site
6449b0b is described below

commit 6449b0b1675f06e3e5a2929dd91c41b433243835
Author: Zoran Regvart <zregvart+git...@gmail.com>
AuthorDate: Sat Mar 2 19:53:37 2019 +0100

    chore: try to publish to asf-site
---
 .github/action-website/Dockerfile |  2 ++
 .github/action-website/publish    | 12 ++++++++++++
 .github/main.workflow             | 19 ++++++++++++++++---
 3 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/.github/action-website/Dockerfile 
b/.github/action-website/Dockerfile
index 04f6a49..1512bd7 100644
--- a/.github/action-website/Dockerfile
+++ b/.github/action-website/Dockerfile
@@ -21,3 +21,5 @@ RUN set -ex \
     libxtst6 \
   && rm -rf /var/lib/apt/lists/*
 
+ADD publish
+
diff --git a/.github/action-website/publish b/.github/action-website/publish
new file mode 100755
index 0000000..9b3d05b
--- /dev/null
+++ b/.github/action-website/publish
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+mkdir -p deploy/staging
+cd deploy/staging
+
+git clone -b asf-site https://github.com/repos/asf/camel-website.git .
+git rm -r *
+cp -R $GITHUB_WORKSPACE/public/* .
+git add .
+git commit -m "Website updated to $(git rev-parse --short HEAD)"
+git push origin asf-site
+
diff --git a/.github/main.workflow b/.github/main.workflow
index 4d7f17e..5cb5ba8 100644
--- a/.github/main.workflow
+++ b/.github/main.workflow
@@ -1,17 +1,30 @@
 workflow "Build and publish the website" {
   on = "push"
-  resolves = ["Build website"]
+  resolves = ["Publish to staging"]
 }
 
 action "Build theme" {
-  uses = "./.github/action-website/"
+  uses = "./.github/action-website"
   runs = "yarn"
   args = "--non-interactive --frozen-lockfile --cwd antora-ui-camel"
 }
 
 action "Build website" {
-  uses = "./.github/action-website/"
+  uses = "./.github/action-website"
   needs = ["Build theme"]
   runs = "yarn"
   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" {
+  uses = "./.github/action-website"
+  needs = ["Filter on master branch"]
+  runs = "publish"
+  secrets = ["GITHUB_TOKEN"]
+}

Reply via email to