forked from whatwg/html
-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (45 loc) · 1.83 KB
/
build.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
name: Build
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
path: 'source'
- name: Build
run: |
mkdir output
docker run --mount "type=bind,source=$GITHUB_WORKSPACE/source,destination=/whatwg/html,readonly=1" \
--env "HTML_SOURCE=/whatwg/html" \
--mount "type=bind,source=$GITHUB_WORKSPACE/output,destination=/whatwg/output" \
--env "HTML_OUTPUT=/whatwg/output" \
ghcr.io/whatwg/html-build
- name: Deploy
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
env:
SERVER: ${{ secrets.MARQUEE_SERVER }}
SERVER_PUBLIC_KEY: ${{ secrets.MARQUEE_PUBLIC_KEY }}
SERVER_DEPLOY_KEY: ${{ secrets.MARQUEE_DEPLOY_KEY }}
run: |
eval "$(ssh-agent -s)"
echo "$SERVER_DEPLOY_KEY" | ssh-add -
mkdir -p ~/.ssh/ && echo "$SERVER $SERVER_PUBLIC_KEY" > ~/.ssh/known_hosts
# Sync, including deletes, but ignoring the stuff we'll deploy below, so that we don't delete them.
# --chmod=D755,F644 means read-write for user, read-only for others.
echo "Deploying build output..."
rsync --archive --chmod=D755,F644 --compress --verbose \
--delete --exclude="commit-snapshots" --exclude="review-drafts" \
"$GITHUB_WORKSPACE/output/" "deploy@$SERVER:/var/www/html.spec.whatwg.org"
echo ""
echo "Deploying Commit Snapshot and Review Drafts, if any..."
rsync --archive --chmod=D755,F644 --compress --verbose \
"$GITHUB_WORKSPACE/output/commit-snapshots" "$GITHUB_WORKSPACE/output/review-drafts" "deploy@$SERVER:/var/www/html.spec.whatwg.org"