-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (51 loc) · 1.64 KB
/
update.yaml
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
name: Update
on:
workflow_dispatch:
schedule:
# Once a week on Saturday
- cron: '5 14 * * 6'
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup python environment
run: conda create --quiet --name rse
- name: Install Development RSE
run: |
export PATH="/usr/share/miniconda/bin:$PATH"
source activate rse
git clone https://github.com/rseng/rse
cd rse
pip install .[all]
cd ../
rm -rf rse
- name: Update Web Interface
run: |
export PATH="/usr/share/miniconda/bin:$PATH"
source activate rse
git clone https://github.com/rseng/software
cd software
rse export --type jekyll-web ../
cd ../
rm -rf software
- name: Push Changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
printf "GitHub Actor: ${GITHUB_ACTOR}\n"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git fetch
git branch
git config --global user.name "github-actions"
git config --global user.email "github-actions@users.noreply.github.com"
git checkout main
git add _software/*
git status
if git diff-index --quiet HEAD --; then
printf "No changes\n"
else
printf "Changes\n"
git commit -a -m "Automated deployment to update software and UI $(date '+%Y-%m-%d')"
git push origin main
fi