From d673ba2d1501cfb5aa4ead4cb3ea24fc11fa36d9 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Wed, 18 Sep 2019 22:00:34 +0200 Subject: [PATCH] Request page build through GitHub API --- Dockerfile | 3 +++ action.yml | 3 --- entrypoint.sh | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c873621..1a5ebdd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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" ] diff --git a/action.yml b/action.yml index 29495cf..62dd549 100644 --- a/action.yml +++ b/action.yml @@ -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' diff --git a/entrypoint.sh b/entrypoint.sh index 7f38ebf..6661304 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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."