-
Notifications
You must be signed in to change notification settings - Fork 3
72 lines (62 loc) · 1.73 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: main
on:
workflow_dispatch:
pull_request:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python (pip)
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: .github/workflows/main.yml
- name: Install poetry
run: |
python3 -m pip install --upgrade poetry==1.8.3
- name: Setup Python (poetry)
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'poetry'
- name: Install dependencies
run: |
poetry install
- name: Build
run: |
poetry run mkdocs build --strict
- name: Pack result
run: |
tar -czf site.tar.gz ./site
- name: Upload Results
uses: actions/upload-artifact@v4
with:
name: website
path: site.tar.gz
deploy-docker:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
if: (github.repository == 'digital-blueprint/handbook' && github.event_name == 'push' && github.ref == 'refs/heads/main')
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Log in
run: |
echo "$TOKEN" | docker login ghcr.io --username "$USERNAME" --password-stdin
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
USERNAME: ${{ github.actor }}
- name: Build image
run: |
docker build --tag ghcr.io/digital-blueprint/handbook:latest .
- name: Deploy image
run: |
docker push ghcr.io/digital-blueprint/handbook:latest