Skip to content

Commit 0e558e9

Browse files
committed
Add GitHub Actions workflows for blog updates and snake game generation; update README with image links
1 parent 4a79c53 commit 0e558e9

File tree

3 files changed

+72
-3
lines changed

3 files changed

+72
-3
lines changed

.github/workflows/blog.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Blog post workflow
2+
on:
3+
schedule:
4+
# Runs once every 3 days
5+
- cron: '0 0 */3 * *'
6+
7+
workflow_dispatch:
8+
9+
jobs:
10+
pull_blog_rss:
11+
name: Update with latest blog posts
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Get RSS Feed
16+
uses: kohrongying/readme-the-rss@master
17+
with:
18+
feed_url: https://blogr.conceptcodes.dev/feed.xml
19+
count: 3 # default 5
20+
- name: Commit file changes
21+
run: |
22+
git config --global user.name 'conceptcodes'
23+
git config --global user.email '[email protected]'
24+
git add .
25+
git diff --quiet --cached || git commit -m "chore(readme): update blog section"
26+
- name: Push changes
27+
uses: ad-m/github-push-action@master
28+
with:
29+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/snake.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Generate Snake
2+
3+
on:
4+
# run automatically every 24 hours
5+
schedule:
6+
- cron: "0 */24 * * *"
7+
8+
# allows to manually run the job at any time
9+
workflow_dispatch:
10+
11+
12+
jobs:
13+
generate:
14+
permissions:
15+
contents: write
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 5
18+
19+
steps:
20+
# generates a snake game from a github user (<github_user_name>) contributions graph, output a svg animation at <svg_out_path>
21+
- name: generate github-contribution-grid-snake.svg
22+
uses: Platane/snk/svg-only@v3
23+
with:
24+
github_user_name: ${{ github.repository_owner }}
25+
outputs: |
26+
dist/github-contribution-grid-snake.svg
27+
dist/github-contribution-grid-snake-dark.svg?palette=github-dark
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
31+
32+
# push the content of <build_dir> to a branch
33+
# the content will be available at https://raw.githubusercontent.com/<github_user>/<repository>/<target_branch>/<file> , or as github page
34+
- name: push github-contribution-grid-snake.svg to the output branch
35+
uses: crazy-max/[email protected]
36+
with:
37+
target_branch: output
38+
build_dir: dist
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.MD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Hey Neighbor! Welcome to my github profile. I'm an experienced software engineer
77
I'm always eager to explore the latest technologies and keep up with the ever-evolving software engineering landscape. Through my blog, I share my expertise, experiences, and insights in web development, covering various topics and trends in the tech industry.
88

99
<picture>
10-
<source media="(prefers-color-scheme: dark)" srcset="github-snake-dark.svg" />
11-
<source media="(prefers-color-scheme: light)" srcset="github-snake.svg" />
12-
<img alt="github-snake" src="github-snake.svg" />
10+
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/ConceptCodes/conceptcodes/blob/output/github-contribution-grid-snake-dark.svg" />
11+
<source media="(prefers-color-scheme: light)" srcset="https://github.com/ConceptCodes/conceptcodes/blob/output/github-contribution-grid-snake.svg" />
12+
<img alt="github-snake" src="https://github.com/ConceptCodes/conceptcodes/blob/output/github-contribution-grid-snake.svg" />
1313
</picture>
1414

1515
## Get in Touch

0 commit comments

Comments
 (0)