Skip to content

Commit

Permalink
feat: documentation preview (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
ejfitzgerald authored Mar 14, 2022
1 parent 38dbb8a commit 32af1b6
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/docs_pr_preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Documentation Preview

on:
pull_request:
branches:
- master
paths:
- 'docs/**'

jobs:
build:
name: Docs Ephemerial Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Use python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Install Dependencies
run: cd docs && pip3 install pipenv && pipenv install

- name: Build
run: cd docs && pipenv run mkdocs build

- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: dist
path: docs/site

deploy:
name: Docs Ephemerial Deploy
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Download Artifact
uses: actions/download-artifact@master
with:
name: dist
path: docs/site

- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
expires: 5d
projectId: fetch-docs-preview
entryPoint: docs/
5 changes: 5 additions & 0 deletions docs/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "fetch-docs-preview"
}
}
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
site/
.firebase/
10 changes: 10 additions & 0 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3.9-slim
RUN pip3 install pipenv

WORKDIR /app
ADD Pipfile Pipfile.lock /app/
RUN pipenv install --system --deploy
RUN mkdir /app/site

ENTRYPOINT [ "mkdocs" ]
CMD ["build"]
12 changes: 12 additions & 0 deletions docs/build-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -e

TAG_NAME=fetchd-docs-build:latest

# ensure the output folder is created
mkdir -p site

# build the latest image
docker build -t "${TAG_NAME}" .

docker run --rm -v "${PWD}:/app" "${TAG_NAME}"
10 changes: 10 additions & 0 deletions docs/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"hosting": {
"public": "site",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
}
}

0 comments on commit 32af1b6

Please sign in to comment.