Skip to content

Commit

Permalink
ci: Deploy emscripten
Browse files Browse the repository at this point in the history
Automatically deploy the emscripten build to a branch building GitHub pages.
  • Loading branch information
Fahien committed Mar 4, 2021
1 parent 910b0d6 commit 5f473f3
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5f473f3

Please sign in to comment.