-
Notifications
You must be signed in to change notification settings - Fork 8
81 lines (70 loc) · 2.52 KB
/
javadocs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: javadocs
on:
push:
# tags:
# - '**'
workflow_dispatch:
jobs:
build:
name: Deploy Javadocs
runs-on: "ubuntu-latest"
if:
${{ github.repository == 'ChatTriggers/ctjs' }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 17
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build Javadocs
run: ./gradlew --no-daemon dokkaHtml
- name: Publish Javadocs
uses: appleboy/scp-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.ACTIONS_DEPLOYER_USERNAME }}
key: ${{ secrets.ACTIONS_DEPLOYER_SSH_KEY }}
passphrase: ${{ secrets.ACTIONS_DEPLOYER_PASSPHRASE }}
source: build/javadocs/
# TODO: Remove "new-" when we transition to 3.0.0
target: /srv/www/static/home/new-javadocs
strip_components: 2
rm: true
- name: Set File Permissions
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: |
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