Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/docs_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Refact Docs Build
# This workflow can be triggered manually
on:
workflow_dispatch:

jobs:
setup-vars:
name: Setup variables
runs-on: ubuntu-latest
outputs:
now_tag: ${{ steps.set-variables.outputs.now_tag }}
steps:
- id: set-variables
name: Setup variables
shell: bash
run: |
GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
if [[ ${GIT_BRANCH} == "main" ]]; then
echo "now_tag=${GIT_BRANCH}.$(TZ=UTC date +'%Y-%m-%dT%H-%M-%SZ')" >> "$GITHUB_OUTPUT"
else
echo "now_tag=${GIT_BRANCH}" >> "$GITHUB_OUTPUT"
fi

build-and-push-image:
name: Dockerize and push
runs-on: ubuntu-latest
needs: [setup-vars]
steps:
# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc

- uses: actions/checkout@v3
- name: npm install
working-directory: ./docs
run: |
npm install
npm run build

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Install GCloud
uses: google-github-actions/setup-gcloud@v2

- name: Login to GAR
uses: docker/login-action@v2
with:
registry: europe-west4-docker.pkg.dev
username: _json_key
password: ${{ secrets.GAR_JSON_KEY }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push
uses: docker/build-push-action@v4
with:
context: ./docs
file: ./docs/Dockerfile
push: true
tags: |
europe-west4-docker.pkg.dev/small-storage1/databases-and-such/docs-refact-ai:${{ needs.setup-vars.outputs.now_tag }}
platforms: |
linux/amd64
5 changes: 5 additions & 0 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM nginx
COPY dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf

# docker build -t europe-west4-docker.pkg.dev/small-storage1/databases-and-such/refact-ai:20230825 .
51 changes: 51 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Starlight Starter Kit: Basics

```
npm create astro@latest -- --template starlight
```

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics)

> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!

## 🚀 Project Structure

Inside of your Astro + Starlight project, you'll see the following folders and files:

```
.
├── public/
├── src/
│ ├── assets/
│ ├── content/
│ │ ├── docs/
│ │ └── config.ts
│ └── env.d.ts
├── astro.config.mjs
├── package.json
└── tsconfig.json
```

Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.

Images can be added to `src/assets/` and embedded in Markdown with a relative link.

Static assets, like favicons, can be placed in the `public/` directory.

## 🧞 Commands

All commands are run from the root of the project, from a terminal:

| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |

## 👀 Want to learn more?

Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).
Loading
Loading