From 47455adf28808154d712fbe9210a8533aed5e55c Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Fri, 18 Aug 2023 15:44:36 +0530 Subject: [PATCH] .github: automate website publication Signed-off-by: Rohit Yadav --- .github/workflows/publish.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..27d15d8 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: Publish Website + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: 16.x + cache: yarn + - run: | + yarn install --frozen-lockfile + yarn build + export WWW_COMMIT=`git rev-parse HEAD` + + - name: Publish PR change to www branch + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_branch: www + publish_dir: ./build + destination_dir: ./ + user_name: 'github-actions[bot]' + user_email: 'github-actions[bot]@users.noreply.github.com' + commit_message: 'Published onprem.in website using branch@commit ${{ github.event.inputs.branch }}@${{ env.WWW_COMMIT }}' + #force_orphan: true