Add repo input
This commit is contained in:
parent
068e494270
commit
08d0501ff9
|
@ -70,10 +70,11 @@ Docker :whale: image is also provided and automatically updated within [Docker H
|
||||||
|
|
||||||
Following inputs can be used as `step.with` keys
|
Following inputs can be used as `step.with` keys
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
|-----------------|---------|-----------------------------------------------------------------|
|
|-----------------|---------|-----------------------------------------------------------------------------------------|
|
||||||
| `target_branch` | String | Git branch where assets will be deployed (default `gh-pages`) |
|
| `repo` | String | GitHub repository where assets will be deployed. Example: portapps/portapps.github.io |
|
||||||
| `build_dir` | String | Path to build directory to deploy |
|
| `target_branch` | String | Git branch where assets will be deployed (default `gh-pages`) |
|
||||||
|
| `build_dir` | String | Path to build directory to deploy |
|
||||||
|
|
||||||
### environment variables
|
### environment variables
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,10 @@ branding:
|
||||||
icon: 'upload-cloud'
|
icon: 'upload-cloud'
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
|
repo:
|
||||||
|
description: 'GitHub repository where assets will be deployed. Example: portapps/portapps.github.io'
|
||||||
target_branch:
|
target_branch:
|
||||||
description: 'Git branch where assets will be deployed'
|
description: 'Git branch where assets will be deployed'
|
||||||
required: false
|
|
||||||
default: 'gh-pages'
|
default: 'gh-pages'
|
||||||
build_dir:
|
build_dir:
|
||||||
description: 'Path to build directory to deploy'
|
description: 'Path to build directory to deploy'
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
REPO=${INPUT_REPO:-$GITHUB_REPOSITORY}
|
||||||
|
|
||||||
if [ -z "$INPUT_TARGET_BRANCH" ]; then
|
if [ -z "$INPUT_TARGET_BRANCH" ]; then
|
||||||
echo "⛔️ Target branch not defined"
|
echo "⛔️ Target branch not defined"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -18,7 +20,7 @@ git config user.name "${GITHUB_ACTOR}"
|
||||||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
|
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
|
||||||
git add .
|
git add .
|
||||||
git commit --allow-empty -m 'Deploy to GitHub pages'
|
git commit --allow-empty -m 'Deploy to GitHub pages'
|
||||||
git push --force --quiet https://${GITHUB_PAT:-"x-access-token:$GITHUB_TOKEN"}@github.com/${GITHUB_REPOSITORY}.git master:${INPUT_TARGET_BRANCH}
|
git push --force --quiet "https://${GITHUB_PAT:-"x-access-token:$GITHUB_TOKEN"}@github.com/${REPO}.git" "master:${INPUT_TARGET_BRANCH}"
|
||||||
rm -rf .git
|
rm -rf .git
|
||||||
|
|
||||||
# Tried https://developer.github.com/v3/repos/pages/#request-a-page-build
|
# Tried https://developer.github.com/v3/repos/pages/#request-a-page-build
|
||||||
|
|
Loading…
Reference in New Issue
Block a user