-
-
Notifications
You must be signed in to change notification settings - Fork 9
100 lines (82 loc) · 3.34 KB
/
publications.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# This is a basic workflow to help you get started with Actions
name: publication upload academic
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
paths:
- '*.bib'
pull_request:
branches: [ master ]
paths:
- '*.bib'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
update_publications:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: branch name output
run: |
echo Pub-$GITHUB_RUN_NUMBER
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 0.74.2
extended: true
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: New Branch
run: |
git checkout -b Pub-$GITHUB_RUN_NUMBER master
#installs python on the machine
- name: install python
uses: actions/setup-python@v1
#Install academic on the machine
- name: Pip Installer
# You may pin to the exact commit or the version.
# uses: BSFishy/pip-action@8f2d471d809dc20b6ada98c91910b6ae6243f318
uses: BSFishy/pip-action@v1
# git+https://github.com/wowchemy/hugo-academic-cli.git
with:
# The packages to install from Pip (if the new academic version is pushed can replace git-etc with academic)
packages: academic
upgrade: true
# Runs a single command using the runners shell
- name: Run academic import
run: |
academic import --overwrite --bibtex publications.bib #path to use
# - name: Create A File
# # You may pin to the exact commit or the version.
# # uses: 1arp/create-a-file-action@ee80edaa4741d9997dbe053e052329d4070c020c
# uses: 1arp/[email protected]
# with:
# file: Test.txt
# content: "Hello World"
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "Add changes" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: Pub-${{ GITHUB.RUN_NUMBER}}
- name: GitHub Pull Request Action
# You may pin to the exact commit or the version.
# uses: repo-sync/pull-request@d80b305e358ef8131f270608735c72e2c913f2af
uses: repo-sync/[email protected]
with:
# Branch name to pull from, default is triggered branch
source_branch: Pub-${{ GITHUB.RUN_NUMBER}}
# Branch name to sync to in this repo, default is master
destination_branch: master
# Pull request title
pr_title: Merge in updated publications
# Pull request body
pr_body: publications have just been updated based on the new publications.bib file
# GitHub token secret
github_token: ${{ secrets.GITHUB_TOKEN }}