File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Site build
2+ on :
3+ workflow_dispatch :
4+ inputs :
5+ post_title :
6+ description : ' Used for filename and post.sh name. The space will be replaced by `-` inv the file name.'
7+ default : ' '
8+ required : true
9+ post_body :
10+ description : ' Use GitHub MD format'
11+ default : ' This week on Java Club we will review the'
12+ required : true
13+ room :
14+ description : ' Choose place: Online|in Jamaica (room 223)|in Spain (room 426)'
15+ default : ' Online'
16+ required : true
17+ tags :
18+ description : ' Capitalized Tags separated by commas'
19+ default : ' '
20+ required : true
21+ jobs :
22+ build :
23+ name : Build
24+ runs-on : ubuntu-latest
25+
26+ env :
27+ FILENAME : ./_posts/$(date +'%Y-%m-%d')-$( echo 'Event#${{ github.event.inputs.post_title }}' | sed -r 's/[# ]+/-/g' ).md
28+ MESSAGE : ${{ github.event.inputs.post_body }}
29+ POST : |
30+ ---
31+ layout: post
32+ title: \"Event#${{ github.event.inputs.post_title }}\"
33+ image: /images/default.jpg
34+ tags: [${{ github.event.inputs.tags }}]
35+ date: $(date +'%Y-%m-%d %H:%M:%S %z')
36+ video:
37+ ---
38+
39+ ${{ github.event.inputs.post_body }}
40+ JOIN : Join us next Thursday, at 10:00 ${{ github.event.inputs.room }}
41+ steps :
42+ - name : Checkout repository
43+ uses : actions/checkout@v2
44+
45+ - name : Calculate event number
46+ run : |
47+ lastEvent=$(ls -LR1 | sed -E 's/[0-9]{4}-[0-9]{2}-[0-9]{2}-//;s/Event-//;s/-.*//;s/.md//' | sort -n | tail -1)
48+ nextEvent=$((lastEvent+1))
49+ echo "next_event=nextEvent" >> $GITHUB_ENV
50+
51+ - name : Create post file
52+ run : |
53+ echo "${{ env.next_event }}"
54+
55+
You can’t perform that action at this time.
0 commit comments