Generate images #535
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: Generate images | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
push: | |
branches: [ '**' ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: Configure SSH | |
env: | |
SSH_PRK: ${{ secrets.SSH_PRK }} | |
run: | | |
if [ ! -d ~/.ssh ]; then | |
mkdir ~/.ssh | |
fi | |
ssh-keyscan gitlab.com 2> /dev/null >> ~/.ssh/known_hosts | |
echo $SSH_PRK | base64 -d > ~/.ssh/id_rsa | |
sudo chmod 600 ~/.ssh/id_rsa | |
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub | |
- name: Run | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
./generate-atimes | |
docker build . -t bczhc/gen-img | |
docker run --name gen-img-run bczhc/gen-img | |
docker cp gen-img-run:/home/wolframengine/commits-scatter.svg . | |
docker cp gen-img-run:/home/wolframengine/commits-barchart.svg . | |
REPO_URL='git@github.com:bczhc/bczhc.git' | |
git clone "$REPO_URL" | |
cd bczhc | |
rm -rf .git | |
git init | |
git remote add origin "$REPO_URL" | |
git config --global user.email '<>' | |
git config --global user.name "github-actions-bot" | |
cp ../commits-scatter.svg ../commits-barchart.svg . | |
git add --all | |
git commit -m update | |
git push origin master -f |