Skip to content

Commit 7390ca5

Browse files
authored
Merge pull request #12 from abdnh/deploy
Update publishing workflow
2 parents 1463310 + 14eaea0 commit 7390ca5

5 files changed

Lines changed: 44 additions & 100 deletions

File tree

.github/workflows/gh-pages.yml

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,52 @@
1-
name: GitHub Pages
1+
name: Deploy Jekyll site to Pages
22

33
on:
44
push:
5-
branches:
6-
- master
5+
branches: ["master"]
76

8-
jobs:
9-
jekyll:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- name: setup
13-
uses: actions/checkout@v2
14-
with:
15-
fetch-depth: '0'
7+
workflow_dispatch:
168

17-
- name: 💎 set up ruby
18-
uses: ruby/setup-ruby@v1
19-
with:
20-
ruby-version: 3.1
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
2113

22-
# - name: set up Node.js
23-
# run: sudo apt-get install nodejs
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
2417

25-
- name: install dependencies & build site
26-
uses: limjh16/jekyll-action-ts@v2
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
- name: Setup Ruby
25+
# https://github.com/ruby/setup-ruby/releases/tag/v1.207.0
26+
uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4
2727
with:
28-
enable_cache: true
28+
ruby-version: '3.1' # Not needed with a .ruby-version file
29+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
30+
cache-version: 0 # Increment this number if you need to re-download cached gems
31+
- name: Setup Pages
32+
id: pages
33+
uses: actions/configure-pages@v5
34+
- name: Build with Jekyll
35+
# Outputs to the './_site' directory by default
36+
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
37+
env:
38+
JEKYLL_ENV: production
39+
- name: Upload artifact
40+
# Automatically uploads an artifact from the './_site' directory by default
41+
uses: actions/upload-pages-artifact@v3
2942

30-
- name: deploy
31-
uses: peaceiris/actions-gh-pages@v3
32-
with:
33-
github_token: ${{ secrets.GITHUB_TOKEN }}
34-
publish_dir: ./_site
35-
publish_branch: gh-pages
43+
deploy:
44+
environment:
45+
name: github-pages
46+
url: ${{ steps.deployment.outputs.page_url }}
47+
runs-on: ubuntu-latest
48+
needs: build
49+
steps:
50+
- name: Deploy to GitHub Pages
51+
id: deployment
52+
uses: actions/deploy-pages@v5

Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,3 @@ all: serve
44

55
serve:
66
bundle exec jekyll serve --watch
7-
8-
deploy:
9-
git checkout master
10-
git push
11-
./deploy.sh

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ My personal blog in Arabic. Built with Jekyll.
44

55
## Build Instructions
66

7-
I deploy the site using an [action](.github/workflows/gh-pages.yml),
8-
and don't use Github-provided Jekyll setup because
9-
some of the plugins I need are not whitelisted.
10-
11-
Some notes about building the site on Windows (mostly for my future self)
7+
Some notes about building the site locally on Windows (mostly for my future self)
128
because that's what I normally use and because it's apparently more pain
139
than other platforms:
1410

_config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ include:
2222
exclude:
2323
- Makefile
2424
- TODO.md
25-
- deploy.sh
2625

2726
jekyll-archives:
2827
enabled: ['categories', 'tags']

deploy.sh

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)