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 1a4f477d8a77cab2bbee9f292d36f0fdc9b12c54
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 | 50 ++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 47 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml
index e11c0f1..9bc7197 100644
--- a/.github/workflows/pr.yaml
+++ b/.github/workflows/pr.yaml
@@ -15,14 +15,58 @@
 # limitations under the License.
 #
 
-name: Check Yarn cache
+name: Pull request checks and preview
 
-on: pull_request
+on: pull_request_target
+
+env:
+  CAMEL_ENV: production
 
 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
+  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

Reply via email to