forked from Jigsaw-Code/outline-server
-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (60 loc) · 2.37 KB
/
experimental.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
name: "Experimental Deploy"
on:
schedule:
- cron: "0 */5 * * *"
push:
branches:
- oreoluwa/experimental
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2-beta
with:
node-version: '12'
- name: Checkout repo
uses: actions/checkout@v2
- uses: trilom/[email protected]
if: github.event_name == 'push' || github.event_name == 'pull_request'
id: get-file-changes
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
githubRepo: oreoluwa/outline-server
- name: Check that Dockerfile was changed
id: checkmajorchange
# if: contains(['push', 'pull_request'], github.event_name)
shell: python
run: |
import os
import json
watched_file_patterns = ['third_party/outline-ss-server/METADATA', 'third_party/prometheus/METADATA', 'Dockerfile']
file_path = os.environ['HOME'] + '/files.json'
try:
with open(file_path) as json_file:
changes = json.load(json_file)
changed_files = []
for changed_file in changes:
for file in watched_file_patterns:
if file in changed_file:
changed_files.append(changed_file)
print("::set-output name=fileschanged::{}".format(",".join(changed_files)))
except:
print('File {} not found'.format(file_path))
- name: Download Seihorn downloader
run: |
mkdir -p $GITHUB_WORKSPACE/.bin/seihon
cd $GITHUB_WORKSPACE/.bin/seihon
curl -sfL https://raw.githubusercontent.com/ldez/seihon/master/godownloader.sh | bash -s -- -b .
chmod +x seihon
echo "$GITHUB_WORKSPACE/.bin/seihon" >> $GITHUB_PATH
- name: Register qemu
run: docker run --rm --privileged hypriot/qemu-register
- name: Login to Docker Registry
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: seihon build and publish docker image
env:
DOCKER_BUILDKIT: 1
run: |
readonly IMAGE_TAG="experimental-$(date +%Y-%m-%d)"
readonly NODE_IMAGE="node:12.16.3-alpine"
seihon publish -v "${IMAGE_TAG}" -v "experimental" -i oreoluwa/shadowbox --dry-run=false --template src/shadowbox/docker/tmpl.Dockerfile --targets=arm.v6,arm.v7,arm.v8,amd64,386 -b ${NODE_IMAGE:-12.16.3-alpine}