Skip to content

Commit b4ff156

Browse files
committed
fix: add release-on-tag github workflow file
1 parent c27865e commit b4ff156

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release static site on tag
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build-and-release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Ruby
19+
uses: ruby/setup-ruby@v1
20+
with:
21+
ruby-version: '3.1'
22+
bundler-cache: true
23+
24+
- name: Build with Jekyll
25+
env:
26+
JEKYLL_ENV: production
27+
run: |
28+
bundle exec jekyll build
29+
30+
- name: Archive site
31+
run: |
32+
cd _site
33+
zip -r ../site-static-${{ github.ref_name }}.zip .
34+
35+
- name: Create GitHub Release
36+
id: create_release
37+
uses: softprops/action-gh-release@v2
38+
with:
39+
tag_name: ${{ github.ref_name }}
40+
name: Release ${{ github.ref_name }}
41+
body: |
42+
Automated release for tag ${{ github.ref_name }}.
43+
Contains the static site generated by Jekyll from this commit.
44+
draft: false
45+
prerelease: false
46+
files: |
47+
site-static-${{ github.ref_name }}.zip
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)