Skip to content

Commit 2b229bf

Browse files
Merge pull request #28 from ThomasJButler/development
Development
2 parents 3eff5e9 + 6991b08 commit 2b229bf

File tree

4 files changed

+93
-2
lines changed

4 files changed

+93
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: '20'
28+
cache: 'npm'
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
33+
- name: Build
34+
run: |
35+
npm run build
36+
# Rename index-react.html to index.html in dist
37+
if [ -f dist/index-react.html ]; then
38+
mv dist/index-react.html dist/index.html
39+
fi
40+
# Create .nojekyll file to bypass Jekyll processing
41+
touch dist/.nojekyll
42+
43+
- name: Setup Pages
44+
uses: actions/configure-pages@v4
45+
46+
- name: Upload artifact
47+
uses: actions/upload-pages-artifact@v3
48+
with:
49+
path: './dist'
50+
51+
deploy:
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
runs-on: ubuntu-latest
56+
needs: build
57+
steps:
58+
- name: Deploy to GitHub Pages
59+
id: deployment
60+
uses: actions/deploy-pages@v4

.github/workflows/snake.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Generate Snake
2+
3+
on:
4+
schedule:
5+
# Runs at 12:00 UTC daily
6+
- cron: "0 12 * * *"
7+
workflow_dispatch:
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
generate:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 10
16+
17+
steps:
18+
- name: Generate GitHub Contribution Snake
19+
uses: Platane/snk/svg-only@v3
20+
with:
21+
github_user_name: ThomasJButler
22+
outputs: |
23+
dist/github-contribution-grid-snake.svg
24+
dist/github-contribution-grid-snake-dark.svg?palette=github-dark
25+
26+
- name: Push to GitHub
27+
uses: EndBug/add-and-commit@v9
28+
with:
29+
branch: output
30+
add: 'dist/*'
31+
message: 'Generate contribution snake'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ The truth is, I love the technical challenges too and solving problems with code
126126
---
127127

128128
<p align="center">
129-
<img width="1000" src="https://raw.githubusercontent.com/ThomasJButler/ThomasJButler/output/github-contribution-grid-snake.svg" alt="snake"/>
129+
<img width="1000" src="https://raw.githubusercontent.com/ThomasJButler/ThomasJButler/output/dist/github-contribution-grid-snake.svg" alt="snake"/>
130130
</p>
131131

132132

vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { resolve } from 'path';
55

66
export default defineConfig({
77
root: '.',
8-
base: '/',
8+
base: '/ThomasJButler/',
99
plugins: [
1010
react(),
1111
legacy({

0 commit comments

Comments
 (0)