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

commit ef28463cb3619ddb6e15ddc8a38564cc41c5ebeb
Author: Zoran Regvart <zregv...@apache.org>
AuthorDate: Fri Dec 18 22:21:13 2020 +0100

    chore(build): add build,preview and checks actions
---
 .github/workflows/pr.yaml | 51 ++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 48 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml
index e11c0f1..572826c 100644
--- a/.github/workflows/pr.yaml
+++ b/.github/workflows/pr.yaml
@@ -15,14 +15,59 @@
 # limitations under the License.
 #
 
-name: Check Yarn cache
+name: Pull request checks and preview
 
-on: pull_request
+on: pull_request_target
 
 jobs:
-  check:
+  check-cache:
     runs-on: ubuntu-latest
     steps:
     - uses: actions/checkout@v2.3.3
     - name: Run check
       run: yarn workspaces foreach install --check-cache
+  build:
+    needs: check-cache
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - name: Build
+        run: yarn build-all
+      - uses: actions/upload-artifact@v2
+        with:
+          name: website
+          path: public
+        env:
+          CAMEL_ENV: production
+  preview:
+    needs: build
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/download-artifact@v2
+        with:
+          name: website
+          path: public
+      - name: Preview on Netlify
+        uses: nwtgck/actions-netlify@v1.1
+        with:
+          publish-dir: 'public'
+          github-token: ${{ secrets.GITHUB_TOKEN }}
+          deploy-message: ${{ github.event.number }} ${{ 
github.event.pull_request.title }}
+          alias: preview-${{ github.event.number }}
+          github-deployment-environment: preview
+        env:
+          NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
+          NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
+  checks:
+    needs: build
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions/download-artifact@v2
+        with:
+          name: website
+          path: public
+      - name: Checks
+        run: yarn checks
+        env:
+          CAMEL_ENV: production

Reply via email to