Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
mattco98 committed Jun 25, 2023
1 parent ab97deb commit 95cfb21
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions .github/workflows/javadocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: javadocs

on:
push:
tags:
- '**'
# tags:
# - '**'
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -53,4 +53,33 @@ 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
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
tag=`git name-rev --name-only --tags HEAD`
echo "tag=${tag}"
if [[ "${tag}" != "undefined" ]]; then
echo "Creating archive..."
# 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
# Append the version to the "version" file
echo "${tag}" >> javadocs-archive/versions
fi

0 comments on commit 95cfb21

Please sign in to comment.