Skip to content

undead404 deploys πŸš€ #34

undead404 deploys πŸš€

undead404 deploys πŸš€ #34

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 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 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: cp ./src/index-template.md ./content/files/uk/index.md
- 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 ./src/robots.txt ./book/robots.txt
- uses: actions/download-artifact@v3
with:
name: interactive-examples
path: book/interactive-examples
# - run: chmod +x ./revamp/exe/populate-algolia
- run: chmod +x ./revamp/exe/fix-interactive-examples && ./revamp/exe/fix-interactive-examples
- run: chmod +x ./revamp/exe/move-media && ./revamp/exe/move-media
# Recursively replace all asterisks in folder names with "_asterisk_"
- run: sudo apt install rename
- run: find ./book -depth -type d -name "*" -execdir rename 's/\*/_asterisk_/g' "{}" \;
- uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: build
path: book
deploy:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: build
path: book
# Recursively replace all "_asterisk_" in folder names with asterisks
- run: sudo apt install rename
- run: find ./book -depth -type d -name "*_asterisk_*" -execdir rename 's/_asterisk_/*/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 }}