tangled
alpha
login
or
join now
trnck.dev
/
blog
0
fork
atom
blog.trnck.dev
0
fork
atom
overview
issues
pulls
pipelines
Publish using an actions workflow
Filip Troníček
2 years ago
c99d034a
0ed406c8
+62
1 changed file
expand all
collapse all
unified
split
.github
workflows
deploy.yaml
+62
.github/workflows/deploy.yaml
···
1
1
+
name: Publish to GitHub Pages
2
2
+
3
3
+
# Run when new code is pushed to `main`. Also provide a button for manual deploys.
4
4
+
on:
5
5
+
push:
6
6
+
branches:
7
7
+
- master
8
8
+
workflow_dispatch:
9
9
+
10
10
+
concurrency:
11
11
+
group: github_pages
12
12
+
cancel-in-progress: true
13
13
+
14
14
+
jobs:
15
15
+
build:
16
16
+
runs-on: ubuntu-latest
17
17
+
permissions:
18
18
+
contents: write
19
19
+
steps:
20
20
+
# Jekyll Picture Tag requires libvips libraries for resizing images, which must be installed
21
21
+
- name: Install JPT's dependencies
22
22
+
run: sudo apt-get install libvips-tools libpng-dev libwebp-dev libjpeg-dev libheif-dev
23
23
+
24
24
+
# Put repository source onto the runner so we can build it
25
25
+
- name: Checkout
26
26
+
uses: actions/checkout@v4
27
27
+
28
28
+
# Install the proper version of Ruby and run bundle install
29
29
+
- name: 💎 Setup Ruby
30
30
+
uses: ruby/setup-ruby@v1
31
31
+
with:
32
32
+
bundler-cache: true
33
33
+
cache-version: 2
34
34
+
ruby-version: "3.3"
35
35
+
36
36
+
# Build the site
37
37
+
- name: 🧪 Jekyll build
38
38
+
run: bundle exec jekyll build
39
39
+
env:
40
40
+
JEKYLL_ENV: production
41
41
+
- name: ⏫ Upload artifact to GitHub Pages
42
42
+
id: artifact
43
43
+
uses: actions/upload-pages-artifact@v1
44
44
+
with:
45
45
+
path: _site/
46
46
+
47
47
+
deploy:
48
48
+
needs: build
49
49
+
50
50
+
permissions:
51
51
+
pages: write # to deploy to Pages
52
52
+
id-token: write # to verify the deployment originates from an appropriate source
53
53
+
54
54
+
environment:
55
55
+
name: github-pages
56
56
+
url: ${{ steps.deployment.outputs.page_url }}
57
57
+
58
58
+
runs-on: ubuntu-latest
59
59
+
steps:
60
60
+
- name: Deploy to GitHub Pages
61
61
+
id: deployment
62
62
+
uses: actions/deploy-pages@v1