435673bcb9
* added script for cicd workflow * added new script to cicd docs workflows * updated readme with new script + new structure * removed autodeploy on push to master * made name for removing config dir more informative * remove ascii * test things * apt * adding spacing for ease of reading * removed remove_existing_config.sh from docs ci * code comment * removed matrix notification temporarily * testing moving back to custom runner * tweaked cd * fixed script * remove admonish commands for the moment * made small change to test deploy * switched to large gh runner * namefix for runner * cleanup and test * pulling new changes to cd * removed --no-default-features flag * reintroduced --no-default flag for test * updated readme with new command + note on contributions * reintroduced faster mdbook install * revert test change * removed old versions * add continue on error: false to vercel steps * updated readme with cicd workflow --------- Co-authored-by: Jon Häggblad <jon.haggblad@gmail.com> Co-authored-by: mfahampshire <mfahampshire@protonmail.ch>
104 lines
4.0 KiB
YAML
104 lines
4.0 KiB
YAML
name: cd-docs
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-20.04-16-core
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Install Dependencies (Linux)
|
|
run: sudo apt-get update && sudo apt-get install -y build-essential curl wget libssl-dev libudev-dev squashfs-tools protobuf-compiler
|
|
- name: Install rsync
|
|
run: sudo apt-get install rsync
|
|
- uses: rlespinasse/github-slug-action@v3.x
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18
|
|
- name: Install Rust stable
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
- name: Build all binaries
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --workspace --release
|
|
- name: Install mdbook and plugins
|
|
run: cd documentation && ./install_mdbook_deps.sh
|
|
- name: Remove existing Nym config directory (`~/.nym/`)
|
|
run: cd documentation && ./remove_existing_config.sh
|
|
continue-on-error: false
|
|
- name: Build all projects in documentation/ & move to ~/dist/docs/
|
|
run: cd documentation && ./build_all_to_dist.sh
|
|
continue-on-error: false
|
|
|
|
- name: Post process
|
|
run: cd documentation && ./post_process.sh
|
|
continue-on-error: false
|
|
|
|
- name: Create Vercel project file
|
|
uses: mobiledevops/secret-to-file-action@v1
|
|
with:
|
|
base64-encoded-secret: ${{ secrets.VERCEL_PROJECT_JSON_BASE64 }}
|
|
filename: "project.json"
|
|
is-executable: true
|
|
working-directory: "./dist/docs/.vercel"
|
|
|
|
- name: Install Vercel CLI
|
|
run: npm install --global vercel@latest
|
|
continue-on-error: false
|
|
|
|
- name: Pull Vercel Environment Information (preview)
|
|
if: github.ref != 'refs/heads/master'
|
|
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
|
|
working-directory: dist/docs
|
|
- name: Pull Vercel Environment Information (production)
|
|
if: github.ref == 'refs/heads/master'
|
|
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
|
|
working-directory: dist/docs
|
|
continue-on-error: false
|
|
|
|
- name: Build Project Artifacts (preview)
|
|
if: github.ref != 'refs/heads/master'
|
|
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
|
|
working-directory: dist/docs
|
|
continue-on-error: false
|
|
- name: Build Project Artifacts (production)
|
|
if: github.ref == 'refs/heads/master'
|
|
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
|
|
working-directory: dist/docs
|
|
continue-on-error: false
|
|
|
|
- name: Deploy Project Artifacts to Vercel (preview)
|
|
if: github.ref != 'refs/heads/master'
|
|
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
|
|
working-directory: dist/docs
|
|
- name: Deploy Project Artifacts to Vercel (master)
|
|
if: github.ref == 'refs/heads/master'
|
|
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
|
|
working-directory: dist/docs
|
|
continue-on-error: false
|
|
|
|
- name: Matrix - Node Install
|
|
run: npm install
|
|
working-directory: .github/workflows/support-files
|
|
- name: Matrix - Send Notification
|
|
env:
|
|
NYM_NOTIFICATION_KIND: cd-docs
|
|
NYM_PROJECT_NAME: "Docs CD"
|
|
NYM_CI_WWW_BASE: "${{ secrets.NYM_CD_WWW_BASE }}"
|
|
NYM_CI_WWW_LOCATION: "${{ env.GITHUB_REF_SLUG }}"
|
|
GIT_COMMIT_MESSAGE: "${{ github.event.head_commit.message }}"
|
|
GIT_BRANCH: "${GITHUB_REF##*/}"
|
|
MATRIX_SERVER: "${{ secrets.MATRIX_SERVER }}"
|
|
MATRIX_ROOM: "${{ secrets.MATRIX_ROOM_DOCS }}"
|
|
MATRIX_USER_ID: "${{ secrets.MATRIX_USER_ID }}"
|
|
MATRIX_TOKEN: "${{ secrets.MATRIX_TOKEN }}"
|
|
MATRIX_DEVICE_ID: "${{ secrets.MATRIX_DEVICE_ID }}"
|
|
IS_SUCCESS: "${{ job.status == 'success' }}"
|
|
uses: docker://keybaseio/client:stable-node
|
|
with:
|
|
args: .github/workflows/support-files/notifications/entry_point.sh
|