-
Notifications
You must be signed in to change notification settings - Fork 161
56 lines (53 loc) · 1.48 KB
/
pages.yml
File metadata and controls
56 lines (53 loc) · 1.48 KB
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
name: Deploy to GitHub Pages
on:
push:
branches:
- main
paths:
- 'docs/**'
- '.github/workflows/pages.yml'
- 'gradle/libs.versions.toml'
workflow_run:
workflows: ["Release Alkaa"]
types:
- completed
branches:
- main
permissions:
contents: read
pages: write
id-token: write
jobs:
deploy:
if: |
github.event_name == 'push' ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Extract version
id: get_version
run: |
VERSION=$(grep 'version_name =' gradle/libs.versions.toml | cut -d '"' -f 2)
if [ -z "$VERSION" ]; then
echo "Error: Failed to extract version from gradle/libs.versions.toml"
exit 1
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Update version in HTML
run: |
VERSION=${{ steps.get_version.outputs.version }}
sed -i "s/VERSION_PLACEHOLDER/v$VERSION/g" docs/index.html
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: './docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4