-
Notifications
You must be signed in to change notification settings - Fork 229
181 lines (152 loc) · 6.36 KB
/
jam-post.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: Create Game Jam Post
on:
workflow_dispatch:
inputs:
month-and-year:
description: "The month & year the jam is taking place in"
required: true
default: 'December 2023'
number:
description: "The ordinal number of the jam"
required: true
default: '27th'
video-id:
description: "The jam trailer's YouTube video ID"
required: true
default: 'NE6vIKRfeDo'
itchio-link:
description: "The itch.io link of the jam"
required: true
default: 'https://itch.io/jam/libgdx-jam-27'
date1:
description: "Theme submission start"
required: true
default: '3rd'
date2:
description: "Theme submission end"
required: true
default: '5th of December'
date3:
description: "Theme voting start"
required: true
default: '7th'
date4:
description: "Theme voting end"
required: true
default: '9th of December'
date5:
description: "Jam start"
required: true
default: '10th'
date6:
description: "Jam end"
required: true
default: '16th of December'
jobs:
create-post:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Retrieve post year
run: echo "YEAR=$(date +'%Y')" >> $GITHUB_ENV
- name: Retrieve post date
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Create jam name for link
run: |
TMP="${{ github.event.inputs.month-and-year }}"
TMP="${TMP,,}"
TMP="${TMP// /-}"
echo "JAM-LINK-NAME=${TMP}" >> ${GITHUB_ENV}
- name: Create post content
run: |
CONTENT=$(cat << EOF
---
title: "libGDX Jam ${{ github.event.inputs.month-and-year }}"
classes: wide2
header:
teaser: /assets/images/posts/${{ env.DATE }}/header.jpg
show_author: true
author_username: "raeleus"
author_displayname: "raeleus"
categories: news
---
With our ${{ github.event.inputs.number }} collaboration, the [libGDX Jam](/community/jams/) continues the time-honoured tradition of making awesome games using the best framework out there. We encourage camaraderie, teamwork, and good sportsmanship with a side of well-intentioned buffoonery. The general jam rules can as always be found [here](/community/jams/#rules). **To participate take a look at the official [itch.io page of the jam](${{ github.event.inputs.itchio-link }}).** The humorous jam trailer can be found on [YouTube](https://www.youtube.com/watch?v=${{ github.event.inputs.video-id }}).
Be sure to get involved with the community by joining the libGDX Discord server!
## Schedule
_The theme is yet to be revealed._
<!--The theme is **this**. Good luck everybody!-->
- **Theme Submission:** ${{ github.event.inputs.date1 }} - ${{ github.event.inputs.date2 }}. Everyone will be allowed to submit a theme for the jam.
- **Voting:** ${{ github.event.inputs.date3 }} - ${{ github.event.inputs.date4 }}. Everyone will vote on their favourite theme. May the best win!
- **Jam:** ${{ github.event.inputs.date5 }} - ${{ github.event.inputs.date6 }}. Participants will create their games and rejoice!
<!--## Submissions
The libGDX Jam ${{ github.event.inputs.month-and-year }} is now over! We hope everyone had a lot of fun and are proud to present the [N submissions](${{ github.event.inputs.itchio-link }}/entries).-->
EOF
)
echo "CONTENT<<EOF" >> $GITHUB_ENV
echo "$CONTENT" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create post file
run: |
mkdir -p _posts/${{ env.YEAR }}
echo "${{ env.CONTENT }}" > _posts/${{ env.YEAR }}/${{ env.DATE }}-jam-${{ env.JAM-LINK-NAME }}.md
- name: Retrieve thumbnail
# run: curl -o /assets/images/posts/${{env.DATE}}/header.jpg --create-dirs https://img.youtube.com/vi/${{github.event.inputs.video-id}}/mqdefault.jpg
uses: suisei-cn/actions-download-file@6d20a8a11783bc479f85ccb2015224f937160478
with:
url: "https://img.youtube.com/vi/${{github.event.inputs.video-id}}/mqdefault.jpg"
target: assets/images/posts/${{env.DATE}}/
filename: header.jpg
- name: Commit files
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add _posts/
git add assets/
git commit -m "Add ${{ github.event.inputs.month-and-year }} jam post"
git push
# We can't rely on our usual deploy action since a push by an action doesn't trigger other
# actions (see: https://github.com/orgs/community/discussions/25702), so we're copying
# the stuff over from .github/workflows/github-pages.yml
build:
runs-on: ubuntu-latest
needs: create-post
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
with:
ruby-version: '3.2' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build with Jekyll
# Outputs to the './_site' directory by default
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v2
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2