Skip to content

Commit d95183d

Browse files
authored
Initial commit
0 parents  commit d95183d

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

.github/workflows/preview.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# -------------------------------------------------------------------------------------------------
2+
# This workflow is meant to be copied to the preview repo, in order to handle the actual GitHub
3+
# Pages deployment, along with any other accessory operation, like commenting on a PR.
4+
# Source: https://github.com/EndBug/pages-preview
5+
# -------------------------------------------------------------------------------------------------
6+
7+
name: Deploy previews and comment on PR
8+
on:
9+
workflow_dispatch:
10+
inputs:
11+
ref:
12+
description: 'The ref to deploy'
13+
required: true
14+
type: string
15+
version:
16+
description: 'The version of EndBug/pages-preview that triggered the workflow'
17+
required: true
18+
type: string
19+
20+
21+
permissions:
22+
contents: read
23+
pages: write
24+
id-token: write
25+
26+
concurrency:
27+
group: "pages"
28+
cancel-in-progress: false
29+
30+
jobs:
31+
# VERSION: update before changing the major version
32+
version-check:
33+
name: Check action version
34+
runs-on: ubuntu-latest
35+
steps:
36+
- run: |
37+
if [ "${{ github.event.inputs.version }}" != "v1" ]; then
38+
echo "This workflow is meant to be used with EndBug/pages-preview@v1, please update your action."
39+
exit 1
40+
fi
41+
42+
deploy:
43+
name: Deploy previews to GitHub Pages
44+
runs-on: ubuntu-latest
45+
needs: version-check
46+
47+
environment:
48+
name: github-pages
49+
url: ${{ steps.deployment.outputs.page_url }}
50+
51+
steps:
52+
- uses: actions/checkout@v3
53+
with:
54+
ref: ${{ inputs.ref }}
55+
- uses: actions/configure-pages@v2
56+
- uses: actions/upload-pages-artifact@v1
57+
with:
58+
path: '.'
59+
- id: deployment
60+
uses: actions/deploy-pages@v1

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Preview repo template for [`EndBug/pages-preview`](https://github.com/EndBug/pages-preview)
2+
3+
To create your own preview repo, click the "Use this template" button at the top of the page.
4+
**IMPORTANT**: make sure to tick the "Include all branches" checkbox.
5+
6+
For info on how to finish the setup, check out [the action's README](https://github.com/EndBug/pages-preview#setup).

0 commit comments

Comments
 (0)