Skip to content

Commit

Permalink
[archive] Deploy to GitHub pages (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
BorysShulyak authored Feb 23, 2024
1 parent 837c5a0 commit 90137f3
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 21 deletions.
19 changes: 2 additions & 17 deletions .github/workflows/ci-mr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ on:
pull_request:
branches:
- '*'

jobs:
ci-mr:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -36,20 +38,3 @@ jobs:

- name: Rush rebuild
run: node common/scripts/install-run-rush.js rebuild --verbose

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: archive
path: apps/archive/build

deploy-archive:
needs: ci-mr
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: archive
path: apps/archive/build
- name: Display structure of downloaded files
run: ls -R
44 changes: 42 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ on:
push:
branches:
- main

env:
ARCHIVE_BUILD_PATH: apps/archive/build

jobs:
ci:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
with:
Expand All @@ -29,7 +34,6 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}


- name: Rush Verify Change Logs
run: node common/scripts/install-run-rush.js change --verify

Expand All @@ -45,5 +49,41 @@ jobs:
- name: Rush Rebuild
run: node common/scripts/install-run-rush.js rebuild --verbose

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: archive
path: ${{ env.ARCHIVE_BUILD_PATH }}

- name: Rush Publish
run: node common/scripts/install-run-rush.js publish --apply --target-branch ${{ github.event.repository.default_branch }} --publish --registry ${{ secrets.NPM_REGISTRY_URL }} --npm-auth-token ${{ secrets.NPM_TOKEN }} --add-commit-details
run: node common/scripts/install-run-rush.js publish --apply --target-branch ${{ github.event.repository.default_branch }} --publish --registry ${{ secrets.NPM_REGISTRY_URL }} --npm-auth-token ${{ secrets.NPM_TOKEN }} --add-commit-details

deploy-archive:
needs: ci
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest

steps:
- name: Configure Github Pages
uses: actions/configure-pages@v4

- name: Download archive Artifact
uses: actions/download-artifact@v4
with:
name: archive
path: ${{ env.ARCHIVE_BUILD_PATH }}

- name: Upload archive artifact as GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ env.ARCHIVE_BUILD_PATH }}

- name: Deploy archive to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 2 additions & 2 deletions apps/archive/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ const config = {
favicon: 'img/favicon.png',

// Set the production url of your site here
url: 'https://your-docusaurus-site.example.com',
url: 'https://runespoor-engineering.github.io',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
baseUrl: '/runespoorstack/',
trailingSlash: false,

// GitHub pages deployment config.
Expand Down

0 comments on commit 90137f3

Please sign in to comment.