Sandia Page Nightly Update #901
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v2 | |
- 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@v2 | |
with: | |
python-version: 3.8 | |
- 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 |