-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOC: Issue-118 - Added build and deployment process of homepage to a …
…GitHub actions based workflow, with no need to handle a new branch and push changes to it.
- Loading branch information
1 parent
d65c11e
commit 9382be2
Showing
9 changed files
with
16,549 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: homepage | ||
on: | ||
workflow_dispatch: # manual trigger | ||
inputs: | ||
run-testenv: | ||
description: "Run the build and deployment process of the OpenDuT homepage." | ||
required: false | ||
type: string | ||
default: "false" | ||
pull_request: | ||
types: [ opened, reopened, synchronize, edited, ready_for_review ] | ||
push: | ||
branches: [ | ||
"main", | ||
"development" | ||
] | ||
tags: | ||
- v[0-9]+.[0-9]+.[0-9]+ | ||
- v[0-9]+.[0-9]+.[0-9]+-* | ||
- canary | ||
|
||
jobs: | ||
homepage: | ||
uses: ./.github/workflows/job-homepage.yaml | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
with: | ||
runs-on: "${{ vars.OPENDUT_GH_RUNNER_LARGE || '[\"ubuntu-latest\"]' }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: homepage | ||
on: | ||
workflow_call: # allow this workflow to be called from other workflows | ||
inputs: | ||
runs-on: | ||
default: "['ubuntu-latest']" | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
check_documentation_changed: | ||
name: Check if documentation has changed and a new deploy is needed | ||
runs-on: ${{ fromJson(inputs.runs-on) }} | ||
outputs: | ||
documentation: ${{ steps.filter.outputs.documentation }} | ||
steps: | ||
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | ||
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # https://github.com/dorny/paths-filter/tree/v3.0.2 | ||
id: filter | ||
with: | ||
filters: | | ||
documentation: | ||
- 'doc/**' | ||
- 'opendut-homepage/**' | ||
base: main | ||
|
||
build_homepage: | ||
name: Build the homepage and upload artifact | ||
if: ${{ needs.check_documentation_changed.outputs.documentation == 'true' && (github.ref_name == 'main' || github.ref_name == 'development' || github.ref_type == 'tag') }} | ||
runs-on: ${{ fromJson(inputs.runs-on) }} | ||
needs: check_documentation_changed | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | ||
|
||
- name: Configure GitHub Pages | ||
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b | ||
|
||
- name: Rust setup | ||
uses: ./.github/actions/rust-setup | ||
|
||
- name: Build homepage | ||
run: cargo ci doc homepage build | ||
|
||
- name: Upload homepage artifact | ||
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 | ||
with: | ||
name: "homepage" | ||
path: "./target/ci/homepage" | ||
if-no-files-found: error | ||
retention-days: 1 | ||
|
||
- name: Upload GitHub Pages artifact | ||
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa | ||
with: | ||
path: "./target/ci/homepage" | ||
|
||
deploy_homepage: | ||
name: Deploy the created homepage artifacts to GitHub Pages | ||
if: ${{ needs.check_documentation_changed.outputs.documentation == 'true' && (github.ref_name == 'main' || github.ref_name == 'development' || github.ref_type == 'tag') }} | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
runs-on: ${{ fromJson(inputs.runs-on) }} | ||
needs: build_homepage | ||
environment: | ||
name: github-pages | ||
url: ${{steps.deployment.outputs.page_url}} | ||
steps: | ||
- name: Deploy artifact | ||
id: deployment | ||
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
opendut.eclipse.dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Eclipse openDuT Project Page | ||
|
||
Webpage for the Eclipse openDuT project. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Eclipse openDuT</title> | ||
<link href="resources/bulma.css" rel="stylesheet" /> | ||
<style> | ||
#logo, #funded_by_the_european_union { | ||
max-width: 50%; | ||
} | ||
body { | ||
padding: 1rem; | ||
margin: auto; | ||
max-width: 50rem; | ||
} | ||
</style> | ||
<meta name="viewport" content="width=device-width,initial-scale=1" /> | ||
</head> | ||
<body> | ||
<img | ||
id="logo" | ||
src="resources/logos/logo_light.png" | ||
alt="Eclipse openDuT" | ||
/> | ||
<br> | ||
<br> | ||
<p> | ||
Test Electronic Control Units around the world in a transparent network. | ||
</p> | ||
<br> | ||
<a class="button" href="https://projects.eclipse.org/projects/automotive.opendut">Eclipse Project</a> | ||
<a class="button" href="book/index.html">Documentation</a> | ||
<a class="button" href="https://github.com/eclipse-opendut/opendut/">Code</a> | ||
|
||
<hr> | ||
|
||
<img | ||
id="funded_by_the_european_union" | ||
src="resources/logos/funded_by_the_european_union.svg" | ||
alt="Funded by the European Union" | ||
/> | ||
</body> | ||
</html> |
Oops, something went wrong.