diff --git a/.github/workflows/javadocs.yml b/.github/workflows/javadocs.yml index 9711d82d..751f1692 100644 --- a/.github/workflows/javadocs.yml +++ b/.github/workflows/javadocs.yml @@ -2,8 +2,8 @@ name: javadocs on: push: - tags: - - '**' +# tags: +# - '**' workflow_dispatch: jobs: @@ -53,4 +53,29 @@ jobs: username: ${{ secrets.ACTIONS_DEPLOYER_USERNAME }} key: ${{ secrets.ACTIONS_DEPLOYER_SSH_KEY }} passphrase: ${{ secrets.ACTIONS_DEPLOYER_PASSPHRASE }} - script: chmod -R g+w /srv/www/static/home/new-javadocs + script: | + chmod -R g+w /srv/www/static/home/new-javadocs + chmod -R g+w /srv/www/static/home/javadocs-archive + + - name: Create archives zip file + if: startsWith(github.ref, 'refs/tags/') + 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: | + tag=${{ github.ref_name }} + echo "Creating archive, tag=${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 "${tag}.zip" tmp + mv "${tag}.zip" javadocs-archive + rm -rf tmp + + echo "${tag}" >> javadocs-archive/versions