-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (69 loc) · 2.82 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Update all profiles on push
on:
push:
branches:
- main
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/checkout@v4
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: Python Setup
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip' # caching pip dependencies
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Configure git
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
- name: Generate github profile Readme
run: |
python github-profile/generate_readme.py --data=user-data.yml --output=build/github-profile/README.md
- name: Update github bio using api
run: |
python github-profile/update_github_bio.py --data=user-data.yml --api-token=${{ secrets.PAT }}
- name: Download latex style files and Generate CV tex file
run: |
mkdir -p build/latex-cv
wget https://raw.githubusercontent.com/k4black/cv-template/main/altacv.cls -O build/latex-cv/altacv.cls
wget https://raw.githubusercontent.com/k4black/cv-template/main/pubs-authoryear.cfg -O build/latex-cv/pubs-authoryear.cfg
wget https://raw.githubusercontent.com/k4black/cv-template/main/pubs-num.cfg -O build/latex-cv/pubs-num.cfg
cp -r latex-cv/. build/latex-cv
python latex-cv/generate_tex.py --data=user-data.yml --output=build/latex-cv/cv.tex
ls -lah build/latex-cv
- name: Generate CV pdf file
uses: xu-cheng/latex-action@v3
continue-on-error: true
with:
working_directory: build/latex-cv
root_file: cv.tex
continue_on_error: true
args: >
-pdf
-shell-escape
-interaction=nonstopmode
-file-line-error
- name: Create CV artifact
uses: actions/upload-artifact@v4
with:
name: cv
path: build/latex-cv/cv.pdf
- name: Push github profile files
run: |
git clone https://x-access-token:${{ secrets.PAT }}@github.com/k4black/k4black.git remote/github-profile
cp -r build/github-profile/. remote/github-profile
cp -r build/latex-cv/cv.pdf remote/github-profile/chernyshev_cv.pdf
cd remote/github-profile
git add README.md chernyshev_cv.pdf
if ! git diff-index --quiet HEAD; then
git commit -m "Update from auto-profile repo"
git push --force
fi