Skip to content

undead404 deploys 🚀 #53

undead404 deploys 🚀

undead404 deploys 🚀 #53

Workflow file for this run

env:
PRODUCTION: true
name: Deploy
run-name: ${{ github.actor }} deploys 🚀
on:
push:
branches:
- main
jobs:
build-interactive-examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: webdoky/interactive-examples
ref: master
- uses: actions/setup-node@v4
with:
node-version: "18"
- run: yarn install
- run: yarn build
- uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: interactive-examples
path: ./docs/
build-revamp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
- uses: actions/setup-go@v4
with:
go-version: "1.20"
- name: Install dependencies
run: "go get ..."
- name: Build index generator
run: cd revamp/generators/src/index && go build -o ../../../../exe/
- name: Build summary generator
run: cd revamp/generators/src/summary && go build -o ../../../../exe/
- name: Build format-links preprocessor
run: cd revamp/preprocessors/src/format-links && go build -o ../../../../exe/
- name: Build inject-authors preprocessor
run: cd revamp/preprocessors/src/inject-authors && go build -o ../../../../exe/
- name: Build rewire-paths preprocessor
run: cd revamp/preprocessors/src/rewire-paths && go build -o ../../../../exe/
- name: Build run-macros preprocessor
run: cd revamp/preprocessors/src/run-macros && go build -o ../../../../exe/
- name: Build strip-frontmatter preprocessor
run: cd revamp/preprocessors/src/strip-frontmatter && go build -o ../../../../exe/
- name: Build writer preprocessor
run: cd revamp/preprocessors/src/writer && go build -o ../../../../exe/
- name: Build fix-interactive-examples postprocessor
run: cd revamp/postprocessors/src/fix-interactive-examples && go build -o ../../../../exe/
- name: Build revamp-html postprocessor
run: cd revamp/postprocessors/src/revamp-html && go build -o ../../../../exe/
- name: Build move-media postprocessor
run: cd revamp/postprocessors/src/move-media && go build -o ../../../../exe/
- name: Build populate-algolia postprocessor
run: cd revamp/postprocessors/src/populate-algolia && go build -o ../../../../exe/
- uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: revamp
path: ./exe/
build:
needs: [build-interactive-examples, build-revamp]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
submodules: true
- name: Setup MDBook
run: mkdir bin && curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.35/mdbook-v0.4.35-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
- uses: actions/download-artifact@v3
with:
name: revamp
path: revamp/exe
- run: ls ./revamp/exe
- run: chmod +x ./revamp/exe/index && ./revamp/exe/index
- run: chmod +x ./revamp/exe/summary && ./revamp/exe/summary
- run: chmod +x ./revamp/exe/format-links
- run: chmod +x ./revamp/exe/inject-authors
- run: chmod +x ./revamp/exe/rewire-paths
- run: chmod +x ./revamp/exe/run-macros
- run: chmod +x ./revamp/exe/strip-frontmatter
- run: chmod +x ./revamp/exe/writer
- run: ./bin/mdbook build
- run: ls ./book
- run: ls .
- run: cp -r ./live-samples ./book/live-samples
- run: cp -r ./static ./book/static
- run: cp ./src/robots.txt ./book/robots.txt
- uses: actions/download-artifact@v3
with:
name: interactive-examples
path: book/interactive-examples
- run: chmod +x ./revamp/exe/fix-interactive-examples && ./revamp/exe/fix-interactive-examples
- run: chmod +x ./revamp/exe/revamp-html && ./revamp/exe/revamp-html
- run: chmod +x ./revamp/exe/move-media && ./revamp/exe/move-media
- run: sudo apt install rename
# Recursively replace all asterisks in folder names with "_asterisk_"
- run: find ./book -depth -type d -name "*" -execdir rename 's/\*/_asterisk_/g' "{}" \;
# Recursively replace all doublecolons in folder names with "_doublecolon_"
- run: find ./book -depth -type d -name "*" -execdir rename 's/::/_doublecolon_/g' "{}" \;
# Recursively replace all colons in folder names with "_colon_"
- run: find ./book -depth -type d -name "*" -execdir rename 's/:/_colon_/g' "{}" \;
- uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: build
path: book
populate-algolia:
needs: [build, build-revamp]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
submodules: true
- uses: actions/download-artifact@v3
with:
name: revamp
path: revamp/exe
- uses: actions/download-artifact@v3
with:
name: build
path: book
- run: chmod +x ./revamp/exe/populate-algolia
- run: ./revamp/exe/populate-algolia
env:
ALGOLIA_APP_ID: ${{ env.ALGOLIA_APP_ID }}
ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }}
deploy:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: build
path: book
- run: sudo apt install rename
# Recursively replace all "_asterisk_" in folder names with asterisks
- run: find ./book -depth -type d -name "*_asterisk_*" -execdir rename 's/_asterisk_/*/g' "{}" \;
# Recursively replace all "_doublecolon_" in folder names with doublecolons
- run: find ./book -depth -type d -name "*_doublecolon_*" -execdir rename 's/_doublecolon_/::/g' "{}" \;
# Recursively replace all "_colon_" in folder names with colons
- run: find ./book -depth -type d -name "*_colon_*" -execdir rename 's/_colon_/:/g' "{}" \;
- uses: actions/setup-node@v4
with:
node-version: "18"
- run: yarn global add surge
- run: surge --project ./book --domain webdoky3.surge.sh
env:
SURGE_LOGIN: ${{ env.SURGE_LOGIN }}
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}