This repository has been archived by the owner on Jun 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (88 loc) · 3.06 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Release
on:
workflow_dispatch:
push:
branches:
- master
- main
paths:
- '.github/workflows/release.yml'
jobs:
build:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true
steps:
- name: Get current date
id: date
run: |
# shellcheck disable=SC2086
echo "datetime=$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_OUTPUT
- name: Clone jaoafa/jaoweb4
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
with:
repository: jaoafa/jaoweb4
- name: Remove content
run: rm -rf content
# - name: Clone jaoafa/jaoweb-docs
# uses: actions/checkout@v3
# with:
# repository: jaoafa/jaoweb-docs
# path: content
# - name: Download authors.json & categories.json
# run: |
# mkdir -p content/blog
# wget -O content/blog/authors.json https://raw.githubusercontent.com/jaoafa/jaoweb/master/content/blog/authors.json
# wget -O content/blog/categories.json https://raw.githubusercontent.com/jaoafa/jaoweb/master/content/blog/categories.json
- name: Set up Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Nuxt generate
run: npm run generate
- name: Check exists .output/public
run: |
ls -la
test -d .output/public
- name: Set jaoweb SHORT_SHA
id: jaoweb-vars
run: |
# shellcheck disable=SC2086
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
# - name: Set jaoweb-docs SHORT_SHA
# id: docs-vars
# working-directory: ./content
# run: |
# # shellcheck disable=SC2086
# echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Print versions
run: |
# shellcheck disable=SC2086,SC2129
sudo apt-get install pandoc
cat << EOF > dist/versions.md
# Build versions
datetime: ${{ steps.date.outputs.datetime }}
- jaoweb: [${{ steps.jaoweb-vars.outputs.SHORT_SHA }}](https://github.com/jaoafa/jaoweb/commit/${{ steps.jaoweb-vars.outputs.SHORT_SHA }})
EOF
# - jaoweb-docs: [${{ steps.docs-vars.outputs.SHORT_SHA }}](https://github.com/jaoafa/jaoweb-docs/commit/${{ steps.docs-vars.outputs.SHORT_SHA }})
pandoc -s dist/versions.md -o dist/versions.html
rm dist/versions.md
- name: Upload Pages-artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist
deploy:
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4