-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
37 lines (35 loc) · 1.24 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Deploy preview
description: Deploy preview environments for static apps using GitHub Pages
inputs:
branch:
description: The branch from where the GitHub Pages are served (defaults to preview-env)
required: true
default: 'preview-env'
folder:
description: The folder where the artifacts to publish are (defaults to the project root)
required: true
default: '.'
runs:
using: composite
steps:
- name: Generate slug
id: generate_slug
run: echo "##[set-output name=slug;]$(echo ${GITHUB_HEAD_REF#refs/heads/})"
shell: bash
- name: Determine base URL
id: determine_base_url
run: echo "##[set-output name=base_url;]$(echo $GITHUB_REPOSITORY | sed 's/\//.github.io\//')"
shell: bash
- name: Deploy
uses: JamesIves/[email protected]
with:
branch: ${{ inputs.branch }}
folder: ${{ inputs.folder }}
target-folder: ${{ steps.generate_slug.outputs.slug }}
- name: Publish env
uses: marocchino/sticky-pull-request-comment@v2
with:
header: Preview environment
message: |
## Preview environment
https://${{ steps.determine_base_url.outputs.base_url }}/${{ steps.generate_slug.outputs.slug }}/