From f637097d5c4fdaed291625236ece9db8bbc35f92 Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Fri, 19 May 2023 11:38:02 -0400 Subject: [PATCH 1/2] feat: add pr template and pr workflow --- .github/pull_request_template.md | 6 ++++++ .github/workflows/pr.yml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/pr.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000..5cca26ef4e --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,6 @@ +Before Submitting This PR, Please Ensure You Have Completed The Following: + +1. [ ] Are all new documentation files lowercase, with dash separated names (ex. unraid-os.mdx)? +2. [ ] Are all assets (images, etc), located in an assets/ subfolder next to the .md/mdx files? +4. [ ] Have you checked to ensure there aren't other open [Pull Requests](../../../pulls) for the same update/change? +5. [ ] Is the build succeeding? diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000000..0d54447018 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,31 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Build PR + +on: + # Runs on pushes targeting the default branch + pull_request: + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + # Single deploy job since we're just deploying + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install NPM + uses: actions/setup-node@v2.5.2 + with: + version: 19 + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ~/.npm + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: npm- + - name: Install dependencies + run: npm ci + - name: NPM Build + run: npm run build From a0a82d774bef4896384253ba1ff962a84b3a48fa Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Fri, 19 May 2023 11:42:53 -0400 Subject: [PATCH 2/2] feat: github pages build to branch --- .github/workflows/static.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 355bb3a791..a381ae727b 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -55,3 +55,34 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v2 + + deploy_to_branch: + name: Deploy to GitHub Pages (Branch) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + + - name: Install dependencies + run: npm install --frozen-lockfile + - name: Build website + run: npm build + + # Popular action to deploy to GitHub Pages: + # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + # Build output to publish to the `gh-pages` branch: + publish_dir: ./build + # The following lines assign commit authorship to the official + # GH-Actions bot for deploys to `gh-pages` branch: + # https://github.com/actions/checkout/issues/13#issuecomment-724415212 + # The GH actions bot is used by default if you didn't specify the two fields. + # You can swap them out with your own user credentials. + user_name: github-actions[bot] + user_email: 41898282+github-actions[bot]@users.noreply.github.com \ No newline at end of file