File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -58,10 +58,9 @@ Docker :whale: image is also provided and automatically updated within [Docker H
5858- name : Deploy
5959 if : success()
6060 uses : docker://crazymax/ghaction-github-pages
61- with :
62- target_branch : gh-pages
63- build_dir : public
6461 env :
62+ INPUT_TARGET_BRANCH : gh-pages
63+ INPUT_BUILD_DIR : public
6564 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6665` ` `
6766
Original file line number Diff line number Diff line change 11#! /bin/sh
22set -e
33
4- TARGET_BRANCH=$1
5- BUILD_DIR=$2
6-
7- if [ -z " $TARGET_BRANCH " ]; then
4+ if [ -z " $INPUT_TARGET_BRANCH " ]; then
85 echo " ⛔️ Target branch not defined"
96 exit 1
107fi
11- if [ ! -d " $BUILD_DIR " ]; then
8+ if [ ! -d " $INPUT_BUILD_DIR " ]; then
129 echo " ⛔️ Build dir does not exist"
1310 exit 1
1411fi
1512
16- echo " 🏃 Deploying $BUILD_DIR directory to $TARGET_BRANCH branch"
17- cd " $BUILD_DIR "
13+ echo " 🏃 Deploying $INPUT_BUILD_DIR directory to $INPUT_TARGET_BRANCH branch"
14+ cd " $INPUT_BUILD_DIR "
1815
1916git init
2017git config user.name " ${GITHUB_ACTOR} "
2118git config user.email " ${GITHUB_ACTOR} @users.noreply.github.com"
2219git add .
2320git commit --allow-empty -m ' Deploy to GitHub pages'
24- git push --force --quiet https://${GITHUB_PAT:- " x-access-token:$GITHUB_TOKEN " } @github.com/${GITHUB_REPOSITORY} .git master:$TARGET_BRANCH
21+ git push --force --quiet https://${GITHUB_PAT:- " x-access-token:$GITHUB_TOKEN " } @github.com/${GITHUB_REPOSITORY} .git master:${INPUT_TARGET_BRANCH}
2522rm -rf .git
2623
2724cd " $GITHUB_WORKSPACE "
28- echo " 🎉 Content of $BUILD_DIR has been deployed to GitHub Pages."
25+ echo " 🎉 Content of $INPUT_BUILD_DIR has been deployed to GitHub Pages."
You can’t perform that action at this time.
0 commit comments