Skip to content

Commit

Permalink
Merge branch 'develop' into dev-tools/test-data-alias-ownership
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex6323 authored Jul 8, 2024
2 parents 765bc63 + 2541425 commit 88a449d
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/preview-wiki.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Preview Wiki In PR

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.WIKI_VERCEL_PROJECT_ID }}

permissions:
contents: read
pull-requests: write

on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'docs/**'

jobs:
wiki-preview:
runs-on: self-hosted-rust
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Build wiki
run: pnpm iota-docs build

- name: Install Vercel CLI
run: npm install --global vercel@latest

- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
working-directory: ./docs/site

- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
working-directory: ./docs/site

- name: Deploy Project Artifacts to Vercel
run: |
DEPLOYMENT_URL=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})
echo "DEPLOYMENT_URL=$DEPLOYMENT_URL" >> $GITHUB_ENV
working-directory: ./docs/site

- name: Update PR with Deployment URL
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const deploymentUrl = process.env.DEPLOYMENT_URL;
const body = `✅ Vercel Preview Deployment is ready!
[View Preview](${deploymentUrl})`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
});
47 changes: 47 additions & 0 deletions .github/workflows/release-wiki.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release Wiki

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.WIKI_VERCEL_PROJECT_ID }}

on:
workflow_dispatch:

jobs:
wiki-release:
runs-on: self-hosted-rust
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install dependencies
run: pnpm install

- name: Build wiki
run: pnpm iota-docs build

- name: Install Vercel CLI
run: npm install --global vercel@latest

- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
working-directory: ./docs/site

- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
working-directory: ./docs/site

- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
working-directory: ./docs/site

0 comments on commit 88a449d

Please sign in to comment.