-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (47 loc) · 1.28 KB
/
update_data.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
name: Sandia Page Nightly Update
on:
push:
branches:
- main
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
inputs:
git-ref:
description: Git Hash (Optional)
required: false
env:
GITHUB_API_TOKEN: ${{ secrets.SECRET_TOKEN }}
TOKEN_USER: ${{ secrets.TOKEN_USER }}
jobs:
build:
name: data-update
runs-on: [ubuntu-latest]
steps:
- name: Checkout sandialabs.github.io source
uses: actions/checkout@v4
- name: Configure git
run: |
git config --global user.name "${TOKEN_USER}"
git config --global user.email "${TOKEN_USER}@users.noreply.github.com"
git config --global hub.protocol https
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install requirements
run: |
which python
cd $GITHUB_WORKSPACE/_explore/scripts
pip install -r requirements.txt
- name: Run main script
run: |
cd $GITHUB_WORKSPACE/_explore/scripts
./MASTER.sh
echo "DATA_TIMESTAMP=$(date -u '+%F-%H')" >> $GITHUB_ENV
- name: Add results to repository
run: |
cd $GITHUB_WORKSPACE
git add -A .
git commit -m "${DATA_TIMESTAMP} Data Update"
git push origin main