Skip to content

Commit 988c10c

Browse files
authored
Deploy to marquee using GitHub actions (#321)
1 parent 3374e69 commit 988c10c

File tree

5 files changed

+30
-43
lines changed

5 files changed

+30
-43
lines changed

.github/workflows/deploy.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: deploy
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-20.04
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-python@v2
12+
with:
13+
python-version: 3.8
14+
- uses: actions/setup-node@v1
15+
with:
16+
node-version: 14
17+
- run: pip install commonmark==0.9.1
18+
- run: npm install
19+
- run: shellcheck deploy.sh
20+
- run: shellcheck resources.whatwg.org/build/*.sh
21+
- run: bash ./deploy.sh
22+
env:
23+
SERVER: ${{ secrets.MARQUEE_SERVER }}
24+
SERVER_PUBLIC_KEY: ${{ secrets.MARQUEE_PUBLIC_KEY }}
25+
SERVER_DEPLOY_KEY: ${{ secrets.MARQUEE_DEPLOY_KEY }}

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
deploy_key
2-
deploy_key.pub
3-
41
# Keep this list synchronized with https://github.com/whatwg/sg/blob/master/policy-link-mapping.txt
52
whatwg.org/ipr-policy
63
whatwg.org/workstream-policy

.travis.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

deploy.sh

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,13 @@ if [[ "$TRAVIS" == "true" ]]; then
6262
fi
6363

6464
# This ensures that only changes to the master branch get deployed
65-
if [[ "$TRAVIS_BRANCH" != "master" || "$TRAVIS_PULL_REQUEST" != "false" ]]; then
65+
if [[ "$GITHUB_REF" != "refs/heads/master" ]]; then
6666
header "Skipping deploy"
6767
else
6868
header "Synchronizing content with whatwg.org et al"
69-
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
70-
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
71-
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
72-
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
73-
openssl aes-256-cbc -K "$ENCRYPTED_KEY" -iv "$ENCRYPTED_IV" -in deploy_key.enc -out deploy_key -d
74-
chmod 600 deploy_key
7569
eval "$(ssh-agent -s)"
76-
ssh-add deploy_key
77-
echo "$SERVER $SERVER_PUBLIC_KEY" > known_hosts
78-
# --verbose isn't used because there are too many files to list them all
79-
# without exceeding log size limits:
80-
# https://github.com/whatwg/whatwg.org/issues/287
81-
rsync --archive --chmod="D755,F644" --compress --delete --stats --log-file="rsync-log.txt" --rsh="ssh -o UserKnownHostsFile=known_hosts" ./whatwg.org ./*.whatwg.org "deploy@$SERVER:/var/www/"
82-
scp -o="UserKnownHostsFile=known_hosts" rsync-log.txt "deploy@$SERVER:/var/www/whatwg.org/"
83-
echo "Full rsync log at https://whatwg.org/rsync-log.txt"
70+
echo "$SERVER_DEPLOY_KEY" | ssh-add -
71+
mkdir -p ~/.ssh/ && echo "$SERVER $SERVER_PUBLIC_KEY" > ~/.ssh/known_hosts
72+
rsync --verbose --archive --chmod=D755,F644 --compress --delete \
73+
./whatwg.org ./*.whatwg.org "deploy@$SERVER:/var/www/"
8474
fi

deploy_key.enc

-3.17 KB
Binary file not shown.

0 commit comments

Comments
 (0)