-
Notifications
You must be signed in to change notification settings - Fork 36
59 lines (56 loc) · 1.71 KB
/
deployment.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
name: Deploy the Greenbone Documentation
on:
workflow_call:
inputs:
doc_root:
required: true
default: "latest"
type: string
artifact_name:
default: "greenbone-community-docs"
required: true
type: string
permissions:
contents: write
id-token: write
pages: write
jobs:
deploy-docs:
name: Deploy Documentation to GitHub Pages
runs-on: 'ubuntu-latest'
concurrency:
group: github-pages
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: greenbone/actions/checkout@v3
id: checkout
with:
ref: "gh-pages"
- name: Cleanup Document Root
run: |
rm -rf ${{ inputs.doc_root }}
mkdir -p ${{ inputs.doc_root }}
- name: Download Documentation Artifact
uses: actions/download-artifact@v4
with:
name: ${{inputs.artifact_name }}
path: ${{ inputs.doc_root }}
- name: Create GitHub Pages
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add ${{ inputs.doc_root }}
git commit --amend -m "Updating Docs for commit ${{ steps.checkout.outputs.sha }}"
git push --force-with-lease
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: .
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Job Summary
run: |
echo '### Deployment successful! :rocket: https://greenbone.github.io/docs/${{ inputs.doc_root }}' >> $GITHUB_STEP_SUMMARY