From 2986d4a1a48dbf0984a71cb8ebc6cbe72f4a765e Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Sat, 24 Jun 2023 10:57:36 -0700 Subject: [PATCH] tmp --- .github/workflows/javadocs.yml | 35 ++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/javadocs.yml b/.github/workflows/javadocs.yml index 9711d82d..d9f8b9e4 100644 --- a/.github/workflows/javadocs.yml +++ b/.github/workflows/javadocs.yml @@ -2,8 +2,8 @@ name: javadocs on: push: - tags: - - '**' +# tags: +# - '**' workflow_dispatch: jobs: @@ -54,3 +54,34 @@ jobs: key: ${{ secrets.ACTIONS_DEPLOYER_SSH_KEY }} passphrase: ${{ secrets.ACTIONS_DEPLOYER_PASSPHRASE }} script: chmod -R g+w /srv/www/static/home/new-javadocs + + - name: Set tag variable + id: tag + run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT + + - name: Create archives zip file + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.REMOTE_HOST }} + username: ${{ secrets.ACTIONS_DEPLOYER_USERNAME }} + key: ${{ secrets.ACTIONS_DEPLOYER_SSH_KEY }} + passphrase: ${{ secrets.ACTIONS_DEPLOYER_PASSPHRASE }} + script: | + # Do not create an archive if this branch isn't tagged + git symbolic-ref HEAD 2> /dev/null + if [[ $? ]]; then + export GIT_TAG="${{ steps.vars.outputs.tag }}" + echo "GIT_TAG=${GIT_TAG}" + + # Copy the current javadocs to a new dir, remove the "older" directory, and + # save it as a zip file in the archives folder + cd /srv/www/static/home + cp -r new-javadocs tmp + rm -rf tmp/older + zip -r "${GIT_TAG}.zip" tmp + mv "${GIT_TAG}.zip" javadocs-archive + rm -rf tmp + + # Append the version to the "version" file + echo ",${GIT_TAG}" >> javadocs-archive/versions + fi