-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.drone.yml
More file actions
102 lines (95 loc) · 2.7 KB
/
.drone.yml
File metadata and controls
102 lines (95 loc) · 2.7 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
kind: pipeline
name: update-scores
steps:
- name: restore-cache
image: meltwater/drone-cache:1
environment: &minio-cache-env
S3_ENDPOINT: https://minio.teamopen.dev
S3_REGION: eu-west-1
S3_BUCKET: drone-cache-teamopen
# 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-scores
# Each mount path is stored individually, so you can split them later
# without needing a separate cache_key for each of them.
mount:
- './.scores'
- name: restore-cache-instances
image: meltwater/drone-cache:1
environment:
<<: *minio-cache-env
PLUGIN_ARCHIVE_FORMAT: tar
settings:
restore: true
cache_key: update-scores
mount:
- './.instances'
- name: load-data
image: sourcecred/sourcecred:dev
environment:
TARGET_LOAD_TIME_MINS: 35
SOURCECRED_CLI: /code/bin/sourcecred.js
SOURCECRED_GITHUB_TOKEN:
from_secret: SOURCECRED_GITHUB_TOKEN
commands:
- npm i
- gzip -df .sourcecred/cache/*.db.gz || echo "Unpacking ignored"
- node src/cli.js examples/*.package.json ./package.json
- name: rebuild-cache
image: meltwater/drone-cache:1
environment: *minio-cache-env
settings:
rebuild: true
cache_key: update-scores
mount:
- './.scores'
when:
status:
- success
- failure
- name: rebuild-cache-instances
image: meltwater/drone-cache:1
environment:
<<: *minio-cache-env
PLUGIN_ARCHIVE_FORMAT: tar
settings:
rebuild: true
cache_key: update-scores
mount:
- './.instances'
when:
status:
- success
- failure
- name: commit-and-push
image: docker:git
environment:
CNAME: 'scsl.teamopen.dev'
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
- mkdir -p site/v0
- cd site
- cp ../.scores/* v0/
- echo "$CNAME" > CNAME
- git init
- git config user.email "deploy-bot@teamopen.dev"
- 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:teamopen-dev/sourcecred-stack-lookup gh-pages
trigger:
branch:
- master