forked from openproblems-bio/openproblems
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (79 loc) · 2.57 KB
/
Copy pathbuild_docker.yml
File metadata and controls
93 lines (79 loc) · 2.57 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
name: Build Docker images
on:
push:
branches:
- 'master'
- 'test_docker'
jobs:
build_images:
runs-on: ${{ matrix.config.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
env:
BRANCH_NAME: "auto_update_docker_${{ github.run_number }}"
strategy:
fail-fast: false
matrix:
config:
- {name: 'current', os: ubuntu-18.04, python: '3.8' }
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
fetch-depth: 1000
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.config.python }}
- name: Install package & dependencies
run: |
python -m pip install --upgrade pip
pip install -U wheel setuptools
pip install --editable .[evaluate]
python -c "import openproblems"
- name: Build Docker images
run: |
cd workflow
snakemake -j $(grep -c processor /proc/cpuinfo) docker
cd ..
- name: Push Docker images
if: startsWith(github.ref, 'refs/heads/master')
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
cd workflow
snakemake -j $(grep -c processor /proc/cpuinfo) docker_push
cd ..
echo "CHANGED=`git diff --exit-code > /dev/null && echo false || echo true`" >> $GITHUB_ENV
- name: Set up Git branch
if: env.CHANGED == 'true' && startsWith(github.ref, 'refs/heads/master')
run: |
git checkout -b $BRANCH_NAME
git push -u origin $BRANCH_NAME
- name: Commit result
if: env.CHANGED == 'true' && startsWith(github.ref, 'refs/heads/master')
uses: EndBug/add-and-commit@v6
with:
author_name: SingleCellOpenProblems
author_email: singlecellopenproblems@protonmail.com
message: 'Update docker version # ci skip'
add: "docker/.version"
branch: ${{ env.BRANCH_NAME }}
push: false
- name: Create Pull Request
if: env.CHANGED == 'true' && startsWith(github.ref, 'refs/heads/master')
uses: peter-evans/create-pull-request@v3
with:
branch: ${{ env.BRANCH_NAME }}
delete-branch: true
base: master
title: '[auto] Update docker version'
reviewers: scottgigante, dburkhardt
- name: Upload check results on fail
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ matrix.config.name }}_results
path: check