generated from EndBug/preview-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d95183d
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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). |