diff --git a/.github/workflows/build-artifact.yml b/.github/workflows/build-artifact.yml new file mode 100644 index 0000000..212da01 --- /dev/null +++ b/.github/workflows/build-artifact.yml @@ -0,0 +1,47 @@ +name: "Build Artifact" + +on: + workflow_call: + inputs: + preview: + description: "Is this a preview deployment?" + default: false + required: false + type: boolean + url: + description: "Domain the deployment will be hosted on" + required: false + type: string + baseurl: + description: "Path where does are hosted on domain" + required: false + type: string + +env: + NODE_VERSION: "17" + DEPLOY_PREVIEW: ${{ inputs.preview }} + PREVIEW_URL: ${{ inputs.url }} + PREVIEW_BASE_URL: ${{ inputs.baseurl }} + +jobs: + build-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: "Setup Node ${{ env.NODE_VERSION }}" + uses: actions/setup-node@v3 + with: + node-version: "${{ env.NODE_VERSION }}" + cache: "yarn" + - name: "Install Dependencies" + run: "bundle install" + - name: "Build Docs" + run: bundle exec jekyll build + - name: "Upload HTML" + uses: actions/upload-artifact@v3 + with: + name: html + path: _site/ + retention-days: 1 \ No newline at end of file diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml new file mode 100644 index 0000000..9dfd985 --- /dev/null +++ b/.github/workflows/build-pr.yml @@ -0,0 +1,29 @@ +# Based on https://github.com/KyoriPowered/adventure-docs + +name: "Build PR" + +on: + pull_request: + +concurrency: + group: "${{ github.workflow }}-${{ github.event.number || github.ref }}" + cancel-in-progress: true + +jobs: + build: + uses: ./.github/workflows/build-artifact.yaml + with: + preview: true + url: "https://geysermc.github.io" + baseurl: "/docs-previews/pull/${{ github.event.number }}/" + publish-pr-number: + runs-on: "ubuntu-latest" + steps: + - name: "pr number / save" + run: "echo ${{ github.event.number }} > ./pr-num.txt" + - name: "pr number / publish" + uses: actions/upload-artifact@v3 + with: + name: "pr-num" + path: "./pr-num.txt" + retention-days: 1 \ No newline at end of file diff --git a/Gemfile b/Gemfile index 1d7a3a7..b846a2c 100644 --- a/Gemfile +++ b/Gemfile @@ -21,3 +21,5 @@ gem "github-pages", group: :jekyll_plugins # group :jekyll_plugins do # gem "jekyll-github-metadata", "~> 1.0" # end + +gem 'webrick' \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 84226f4..22f6827 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -279,6 +279,7 @@ GEM unf_ext (0.0.8) unf_ext (0.0.8-x64-mingw32) unicode-display_width (1.8.0) + webrick (1.7.0) zeitwerk (2.5.4) PLATFORMS @@ -287,6 +288,7 @@ PLATFORMS DEPENDENCIES github-pages + webrick BUNDLED WITH 2.2.32