Skip to content

Commit

Permalink
build: automate GitHub pages deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
kris7t committed Jun 23, 2024
1 parent 2befbbc commit d187e56
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 5 deletions.
51 changes: 46 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,53 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
./gradlew sonar -Pci --info --stacktrace --max-workers 4 --no-daemon
- name: Upload site artifact
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/upload-artifact@v4
with:
name: site-zip
path: subprojects/docs/build/refinery-docs.zip
reuse-check:
name: REUSE Compliance Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: REUSE Compliance Check
uses: fsfe/reuse-action@a46482ca367aef4454a87620aa37c2be4b2f8106
with:
args: --include-meson-subprojects lint
- uses: actions/checkout@v4
- name: REUSE Compliance Check
uses: fsfe/reuse-action@a46482ca367aef4454a87620aa37c2be4b2f8106
with:
args: --include-meson-subprojects lint
publish-site:
name: Publish to GitHub Pages
if: ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'graphs4value/refinery' }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Diwonload site artifact
uses: actions/download-artifact@v4
with:
name: site-zip
path: refinery-docs.zip
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4
with:
gpg_private_key: ${{ secrets.PGP_KEY }}
fingerprint: ${{ secrets.PGP_FINGERPRINT }}
passphrase: ${{ secrets.PGP_PASSWORD }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Commit and push to graphs4value.github.io
env:
GH_PAGES_TOKEN: ${{ secrets.GH_PAGES_TOKEN }}
GITHUB_REPOSITORY: ${{ github.sha }}
GITHUB_SHA: ${{ github.sha }}
run: |
mkdir graphs4value.github.io
cd graphs4value.github.io
git init
git config user.name "Graphs4Value bot"
git config user.email "refinery@refinery.tools"
git remote add origin "https://x-access-token:${GH_PAGES_TOKEN}@github.com/graphs4value/graphs4value.github.io.git"
unzip ../refinery-docs.zip
git add .
git commit -S -m "Update from https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}"
git push --force origin main
11 changes: 11 additions & 0 deletions subprojects/docs/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,17 @@ tasks {
delete(".docusaurus")
delete(".yarn")
}

val siteZip by registering(Zip::class) {
dependsOn(assembleFrontend)
from(docusaurusOutputDir)
archiveFileName = "refinery-docs.zip"
destinationDirectory = layout.buildDirectory
}

assemble {
dependsOn(siteZip)
}
}

sonarqube.properties {
Expand Down

0 comments on commit d187e56

Please sign in to comment.