-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
86 lines (79 loc) · 2.51 KB
/
.drone.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
82
83
84
85
86
kind: pipeline
name: update-github-pages
clone:
disable: true
steps:
- name: clone
image: docker:git
commands:
- git clone --depth 1 https://github.com/sfosc/sourcecred.git .
- git submodule init
- git submodule update
- name: restore-cache
image: meltwater/drone-cache:1
environment: &minio-cache-env
S3_ENDPOINT: https://minio.sfosc.robin-it.com
S3_REGION: eu-west-1
S3_BUCKET: drone-cache-sfosc
# Path style buckets is used for minio hosts, AWS S3 should be false
PLUGIN_PATH_STYLE: true
PLUGIN_ARCHIVE_FORMAT: gzip
PLUGIN_ACCESS_KEY:
from_secret: MINIO_ACCESS_KEY
PLUGIN_SECRET_KEY:
from_secret: MINIO_SECRET_KEY
settings:
restore: true
cache_key: update-github-pages
# Each mount path is stored individually, so you can split them later
# without needing a separate cache_key for each of them.
mount:
- './sourcecred_data/cache'
- './sourcecred/node_modules'
- './widgets/node_modules'
- name: build
image: node:10
environment:
SOURCECRED_GITHUB_TOKEN:
from_secret: SOURCECRED_GITHUB_TOKEN
SSH_BOT_KEY:
from_secret: SSH_BOT_KEY
commands:
# Use a bot key for reading.
- mkdir -p ~/.ssh
- ssh-keyscan -H github.com >> ~/.ssh/known_hosts
- echo "$SSH_BOT_KEY" > ~/.ssh/id_rsa && chmod 0600 ~/.ssh/id_rsa
- ./scripts/rebuild-site.sh
- name: rebuild-cache
image: meltwater/drone-cache:1
# This is called an alias (the *name), and references an anchor (the &name) for reusing it's values.
# It's part of the YAML specification.
environment: *minio-cache-env
settings:
rebuild: true
cache_key: update-github-pages
mount:
- './sourcecred_data/cache'
- './sourcecred/node_modules'
- './widgets/node_modules'
- name: commit-and-push
image: docker:git
environment:
SSH_DEPLOY_KEY:
from_secret: SSH_DEPLOY_KEY
commands:
# Switch to the secret deploy key.
- mkdir -p ~/.ssh
- ssh-keyscan -H github.com >> ~/.ssh/known_hosts
- echo "$SSH_DEPLOY_KEY" > ~/.ssh/id_rsa && chmod 0600 ~/.ssh/id_rsa
- cd site
- git init
- git config user.email "bot@sfosc.org"
- git config user.name "Deployment Bot"
- git checkout -b gh-pages
- git add --all
- git commit -m "Publishing to gh-pages `date`"
- git push -f git@github.com:sfosc/sourcecred.git gh-pages
trigger:
branch:
- master