-
Notifications
You must be signed in to change notification settings - Fork 2
145 lines (125 loc) · 3.76 KB
/
main.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: AUTO Build and Test
env:
DOCKER_CLIENT_TIMEOUT: "300"
COMPOSE_HTTP_TIMEOUT: "300"
on:
push:
paths:
- "images/**"
- "model/**"
- "scripts/**"
- "dodo.py"
- ".github/workflows/main.yml"
pull_request:
branches: [ main ]
paths:
- "images/**"
- "model/**"
- "scripts/**"
- "dodo.py"
- ".github/workflows/main.yml"
workflow_dispatch:
jobs:
docker-pipeline:
runs-on: ubuntu-latest
if: >
!contains(github.event.head_commit.message , 'skip ci') &&
!contains(github.event.pull_request.title, 'skip ci')
steps:
- name: Checkout after Free Space
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check Free Space 0
run: |
echo "Free space:"
df -h
- name: Docker/ENV cleanup Cleanup
run: |
docker image prune -a -f
docker container prune -f
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Check Free Space 1
run: |
echo "Free space:"
df -h
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Install pip dependencies
run: |
python -m pip install --upgrade pip
pip install -r scripts/requirements.txt
- name: Install selenium dependecies for r studio
run: |
chmod +x ./scripts/selenium_setup.sh
./scripts/selenium_setup.sh
- name: Install pydoit fixed
run: |
git clone https://github.com/davidzyx/doit
pip install ./doit
rm -rf ./doit
mkdir -p logs manifests
touch logs/run.log
- name: Set Python-specific environment variables
run: |
echo "PYTHONPATH=$(pwd)" >> $GITHUB_ENV
echo "PYTHONUNBUFFERED=TRUE" >> $GITHUB_ENV
- name: Setup artifacts
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USER: ${{ github.actor }}
run: |
doit prep
mkdir -p logs
- name: Clone Wiki
uses: actions/checkout@v3
with:
repository: ${{github.repository}}.wiki
path: wiki
- name: Check Free Space 2
run: |
echo "Free space:"
df -h
- name: Build stack
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USER: ${{ github.actor }}
GRPC_CERT: ${{ secrets.GRPC_CERT }}
PREPUSH_IMAGES: '["ghcr.io/ucsd-ets/scipy-ml-notebook"]'
run: |
python3 scripts/main.py
- name: Check Free Space 3
run: |
echo "Free space:"
df -h
- name: Push Wiki to GitHub
if: >
!contains(github.base_ref , 'test') &&
!contains(github.base_ref , 'dev') &&
!contains(github.event.head_commit.message , 'skip push') &&
(
github.ref == 'refs/heads/main'
)
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "[ci skip] Automated publish for ${{github.sha}}"
repository: wiki/
- name: Archive artifacts and logs
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: |
artifacts
logs
manifests