Deploy #29
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
name: Deploy | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
env: | |
NODE_VERSION: 18.16.0 | |
RUST_VERSION: 1.62 | |
RUST_FMT: nightly-2023-04-01-x86_64-unknown-linux-gnu | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: yarn | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: | | |
packages/rust-bindings | |
deps/concordium-base/rust-src | |
deps/concordium-base/concordium-contracts-common | |
- name: Cache dependencies | |
id: yarn-cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
./node_modules | |
./docs/node_modules | |
./packages/ccd-js-gen/node_modules | |
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | |
- name: Cache GRPC | |
id: cache-grpc | |
uses: actions/cache@v3 | |
with: | |
path: | | |
./packages/sdk/src/grpc-api | |
key: ${{ runner.os }}-grpc-${{ hashFiles('deps/concordium-base/concordium-grpc-api') }} | |
restore-keys: ${{ runner.os }}-grpc | |
- name: Get dependencies | |
if: steps.yarn-cache.outputs.cache-hit != 'true' | |
run: yarn install --immutable | |
- name: Build release | |
run: yarn build | |
- name: Store build-release | |
uses: ./.github/actions/upload-artifact | |
with: | |
name: build-release | |
path: | | |
./packages/sdk/lib | |
./packages/sdk/src | |
./packages/ccd-js-gen/lib | |
./packages/ccd-js-gen/src | |
./packages/ccd-js-gen/bin | |
./packages/rust-bindings/lib | |
./packages/*/package.json | |
./packages/*/README.md | |
build-typedoc: | |
runs-on: ubuntu-22.04 | |
needs: build | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: yarn | |
- name: Get build-output | |
uses: ./.github/actions/download-artifact | |
with: | |
name: build-release | |
- name: Restore cached dependencies | |
uses: actions/cache/restore@v3 | |
with: | |
path: | | |
./node_modules | |
./docs/node_modules | |
./packages/ccd-js-gen/node_modules | |
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | |
- name: Generate typedoc documentation | |
run: yarn build:docs | |
- name: Store typedoc | |
uses: ./.github/actions/upload-artifact | |
with: | |
name: typedoc-build | |
path: typedoc | |
deploy-typedoc: | |
needs: build-typedoc | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get typedoc | |
uses: ./.github/actions/download-artifact | |
with: | |
name: typedoc-build | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload GH pages artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: './typedoc' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |