This is an automated email from the ASF dual-hosted git repository.
yufei pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris-site.git
The following commit(s) were added to refs/heads/main by this push:
new bf493fd Add GitHub Action to test website changes (CI) and
automatically deploy on merge on main branch (deploy) (#6)
bf493fd is described below
commit bf493fd2f15491c44568d7efc20fb116f731ec2f
Author: JB Onofré <[email protected]>
AuthorDate: Sat Sep 28 07:35:29 2024 +0200
Add GitHub Action to test website changes (CI) and automatically deploy on
merge on main branch (deploy) (#6)
---
.github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++++++++++++++++
.github/workflows/deploy.yml | 44 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 90 insertions(+)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..d5e35a9
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,46 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: CI
+on:
+ pull_request:
+ branches: [ main ]
+ push:
+ branches: [ main ]
+
+# Concurrency strategy:
+# github.workflow: distinguish this workflow from others
+# github.event_name: distinguish `push` event from `pull_request` event
+# github.event.number: set to the number of the pull request if
`pull_request` event
+# github.run_id: otherwise, it's a `push` event, only cancel if we rerun the
workflow
+#
+# Reference:
+# https://docs.github.com/en/actions/using-jobs/using-concurrency
+#
https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event_name }}-${{
github.event.number || github.run_id }}
+ cancel-in-progress: true
+
+jobs:
+ check:
+ name: Check
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: korandoru/hawkeye@v4
+
+# TODO: enable markdownlint & typos
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
new file mode 100644
index 0000000..7fcbee9
--- /dev/null
+++ b/.github/workflows/deploy.yml
@@ -0,0 +1,44 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Deploy
+
+on:
+ push:
+ branches: [ main ]
+ pull_request:
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 18.x
+ - uses: pnpm/action-setup@v4
+ with:
+ version: 8
+ - run: pnpm install
+ - run: pnpm run build
+ - run: cp .asf.yaml build/.asf.yaml
+ - uses: peaceiris/actions-gh-pages@v3
+ if: github.event_name != 'pull_request'
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ publish_dir: ./build
+ publish_branch: asf-site