Skip to content

Commit

Permalink
docs(website): add job to build website (#189)
Browse files Browse the repository at this point in the history
* docs(website): rename website folder

* ci: add job to build website

* ci: install dependecies before building website

* ci: deploy website

* ci: success also depend on the deployment of the website
  • Loading branch information
kelvin-olaiya authored Jul 19, 2024
1 parent 082ea1f commit fabd20a
Show file tree
Hide file tree
Showing 27 changed files with 51 additions and 4 deletions.
53 changes: 50 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Build
run: ./gradlew build --info
- name: Test
run: ./gradlew auth:test user:test alarm:test device:test log:test notification:test location:test --info
run: ./gradlew auth:test user:test alarm:test device:test log:test notification:test location:test --info --parallel
style:
runs-on: ubuntu-latest
steps:
Expand All @@ -42,7 +42,28 @@ jobs:
run: ./gradlew format --info
- name: Check lint
run: ./gradlew lint --info
build-website:
defaults:
run:
working-directory: docs/website
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: package.json
- name: Build the website
run: |
npm install
npm run build
- uses: actions/upload-artifact@v4.3.4
with:
name: website
path: docs/website/build
compute-next-version:
needs:
- build
- style
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down Expand Up @@ -70,8 +91,8 @@ jobs:
echo "The next version is ${{ steps.compute-next-version.outputs.next-version }}"
release:
needs:
- build
- style
- compute-next-version
- build-website
runs-on: ubuntu-latest
concurrency:
# Only one release job at a time per branch, strictly sequential.
Expand Down Expand Up @@ -105,6 +126,30 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: npx semantic-release
deploy-website:
defaults:
run:
working-directory: docs/website
runs-on: ubuntu-latest
needs:
- build-website
- release
if: >-
!github.event.repository.fork
&& (
github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name == github.repository
) && fromJSON(needs.compute-next-version.outputs.will-release)
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4.1.8
with:
name: website
path: docs/website/build
- uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GH_TOKEN }}
folder: docs/website/build
docker:
name: Push ${{ matrix.image }} image to docker hub
concurrency:
Expand Down Expand Up @@ -164,9 +209,11 @@ jobs:
needs:
- build
- style
- build-website
- release
- docker
- compute-next-version
- deploy-website
# Always run this job, even if the previous jobs failed
if: >-
always() && (failure() || !contains(join(needs.*.result, ','), 'cancelled'))
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const config: Config = {
url: 'https://mala1180.github.io',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
baseUrl: '/revue/',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.

0 comments on commit fabd20a

Please sign in to comment.