-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (39 loc) · 1.51 KB
/
create-gallery.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
name: generate-codeart
on:
pull_request: []
jobs:
GenerateCodeArt:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v1
- name: Setup conda environment
run: conda create --name codeart
- name: Generate Text CodeArt
run: |
export PATH="/usr/share/miniconda/bin:$PATH"
source activate codeart
pip install codeart
mkdir -p docs
codeart textart --root ${PWD} --text codeart --outdir docs/
- name: Open Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_AGAINST: "master"
run: |
echo "GitHub Actor: ${GITHUB_ACTOR}"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git branch
export BRANCH_FROM="update/codeart-$(date '+%Y-%m-%d')"
git checkout -b "${BRANCH_FROM}"
git branch
git config --global user.name "github-actions"
git config --global user.email "github-actions@users.noreply.github.com"
git add docs/index.html
git add docs/images/*.png
git commit -m "Automated deployment to update codeart in docs $(date '+%Y-%m-%d')"
git push origin "${BRANCH_FROM}"
# Absolutely must download specific sha of script
wget https://raw.githubusercontent.com/vsoch/codeart-examples/7d8fe5df60570169abe965c0202aea8d59f04b24/.github/workflows/pull_request.sh
chmod +x pull_request.sh
/bin/bash -e pull_request.sh