From d95183d124af72225d1baaa28b63b259e5660504 Mon Sep 17 00:00:00 2001 From: Juan Pablo Flores Date: Wed, 15 Mar 2023 17:21:13 -0600 Subject: [PATCH] Initial commit --- .github/workflows/preview.yml | 60 +++++++++++++++++++++++++++++++++++ README.md | 6 ++++ 2 files changed, 66 insertions(+) create mode 100644 .github/workflows/preview.yml create mode 100644 README.md diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 00000000000..66b1d15f224 --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,60 @@ +# ------------------------------------------------------------------------------------------------- +# This workflow is meant to be copied to the preview repo, in order to handle the actual GitHub +# Pages deployment, along with any other accessory operation, like commenting on a PR. +# Source: https://github.com/EndBug/pages-preview +# ------------------------------------------------------------------------------------------------- + +name: Deploy previews and comment on PR +on: + workflow_dispatch: + inputs: + ref: + description: 'The ref to deploy' + required: true + type: string + version: + description: 'The version of EndBug/pages-preview that triggered the workflow' + required: true + type: string + + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # VERSION: update before changing the major version + version-check: + name: Check action version + runs-on: ubuntu-latest + steps: + - run: | + if [ "${{ github.event.inputs.version }}" != "v1" ]; then + echo "This workflow is meant to be used with EndBug/pages-preview@v1, please update your action." + exit 1 + fi + + deploy: + name: Deploy previews to GitHub Pages + runs-on: ubuntu-latest + needs: version-check + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ inputs.ref }} + - uses: actions/configure-pages@v2 + - uses: actions/upload-pages-artifact@v1 + with: + path: '.' + - id: deployment + uses: actions/deploy-pages@v1 diff --git a/README.md b/README.md new file mode 100644 index 00000000000..67320a893c4 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# Preview repo template for [`EndBug/pages-preview`](https://github.com/EndBug/pages-preview) + +To create your own preview repo, click the "Use this template" button at the top of the page. +**IMPORTANT**: make sure to tick the "Include all branches" checkbox. + +For info on how to finish the setup, check out [the action's README](https://github.com/EndBug/pages-preview#setup).