-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically deploy the emscripten build to a branch building GitHub pages.
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,3 +143,49 @@ jobs: | |
git add *.tar.gz | ||
git commit --amend -m "$DEPLOY_MESSAGE" || git commit -m "$DEPLOY_MESSAGE" | ||
git push --force || git push --set-upstream origin $DEPLOY_BRANCH | ||
- name: 'Deploy' | ||
if: matrix.BuildType == 'BinDist' | ||
env: | ||
PUBLIC_REPO_TOKEN: ${{ secrets.PUBLIC_REPO_TOKEN }} | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
export PACKAGE_NAME=${GITHUB_REPOSITORY##*/} | ||
export DEPLOY_MESSAGE=`sed 's/PACKAGE_NAME/'"$PACKAGE_NAME"'/' <<< "$DEPLOY_MESSAGE"` | ||
export DEPLOY_BRANCH=pages | ||
export COMMIT_DATE=`git log -1 --format=%ad --date=short` | ||
export ARR_DATE=(${COMMIT_DATE//-/ }) | ||
export MAJOR=${ARR_DATE[0]} | ||
export MINOR=${ARR_DATE[1]} | ||
export REV_COUNT=`git rev-list --count HEAD` | ||
export SHORT_HASH=`git rev-parse --short HEAD` | ||
export PATCH=r${REV_COUNT}-${SHORT_HASH} | ||
export PACKAGE_VERSION=${MAJOR}.${MINOR}.${PATCH} | ||
export TAR_NAME=${PACKAGE_NAME}-${PACKAGE_VERSION}-Emscripten | ||
echo ${TAR_NAME} | ||
cd .. | ||
echo Moving.. | ||
mv $PACKAGE_NAME-artifacts/${TAR_NAME}.tar.gz . | ||
echo Extracting.. | ||
tar -zxvf ${TAR_NAME}.tar.gz | ||
cd $PACKAGE_NAME-artifacts | ||
git checkout $DEPLOY_BRANCH || git checkout --orphan $DEPLOY_BRANCH | ||
git reset | ||
git clean -f | ||
git rm * || true | ||
echo Committing.. | ||
mv ../${TAR_NAME}/bin/* . | ||
mv ncjump.html index.html | ||
git add . | ||
git commit --amend -m "$DEPLOY_MESSAGE" || git commit -m "$DEPLOY_MESSAGE" | ||
echo Pushing.. | ||
git push --force || git push --set-upstream origin $DEPLOY_BRANCH |