Request page build through GitHub API

This commit is contained in:
CrazyMax 2019-09-18 22:00:34 +02:00
parent 71abc70100
commit d673ba2d15
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
3 changed files with 5 additions and 3 deletions

View File

@ -12,6 +12,9 @@ LABEL version="$VERSION" \
"com.github.actions.icon"="upload-cloud" \
"com.github.actions.color"="green"
RUN apk --update --no-cache add curl \
&& rm -rf /var/cache/apk/* /tmp/*
COPY LICENSE README.md /
ADD entrypoint.sh /
ENTRYPOINT [ "/entrypoint.sh" ]

View File

@ -18,8 +18,5 @@ inputs:
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.target_branch }}
- ${{ inputs.build_dir }}
env:
GITHUB_TOKEN: 'As provided by GitHub Actions'

View File

@ -21,5 +21,7 @@ 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}
rm -rf .git
curl -XPOST -H"Authorization: token ${GITHUB_TOKEN}" -H"Accept: application/vnd.github.mister-fantastic-preview+json" https://api.github.com/repos/${GITHUB_REPOSITORY}/pages/builds
cd "$GITHUB_WORKSPACE"
echo "🎉 Content of $INPUT_BUILD_DIR has been deployed to GitHub Pages."