-
Notifications
You must be signed in to change notification settings - Fork 3
143 lines (137 loc) · 4.24 KB
/
index.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Typesense and or Noske Indexer
on:
workflow_dispatch: {}
env:
ORG: acdh-oeaw
REPO: acdh-indexer
DATA_DIR: data/editions
PROJECT: acdh-indexer
jobs:
fetch_data:
name: Fetch Data from ${{ github.env.DATA_DIR }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache the site
uses: actions/cache@v4
env:
cache-name: cache-site-build
with:
path: ./${{ github.env.DATA_DIR }}
key:
build-${{ env.cache-name }}-${{ hashFiles('**/fetch-data.sh') }}
restore-keys: |
build-${{ env.cache-name }}-
build-
- name: Fetch data
run: ./shellscripts/fetch_data.sh
typesense_index:
needs: [fetch_data]
name: Build Typesense Index
runs-on: ubuntu-latest
env:
TYPESENSE_HOST: typesense.acdh-dev.oeaw.ac.at
TYPESENSE_PORT: 443
TYPESENSE_PROTOCOL: https
TYPESENSE_API_KEY: ${{ secrets.TYPESENSE_API_KEY }}
steps:
- uses: actions/checkout@v4
- name: Use Cache
uses: actions/cache@v4
env:
cache-name: cache-site-build
with:
path: ./${{ github.env.DATA_DIR }}
key:
build-${{ env.cache-name }}-${{ hashFiles('**/fetch-data.sh') }}
restore-keys: |
build-${{ env.cache-name }}-
build-
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pipenv"
- name: Install dependencies
run: |
python --version
python -m pip install pipenv
pipenv install
- name: Build gestrich index data.jsonl
run: pipenv run python typesense/index.py
noske_index:
needs: [fetch_data]
name: Build Noske Index
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Cache editions
uses: actions/cache@v4
env:
cache-name: cache-site-build
with:
path: |
./${{ github.env.DATA_DIR }}
key:
build-${{ env.cache-name }}-${{ hashFiles('**/fetch-data.sh') }}
restore-keys: |
build-${{ env.cache-name }}-
build-
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: "pipenv"
- name: Install dependencies
run: |
python --version
python -m pip install pipenv
pipenv install
- name: Build verticals
run: |
pipenv run python noske/mk_verticals.py
# - name: Commit data
# uses: stefanzweifel/git-auto-commit-action@v4
# with:
# commit_message: Verticals/Created
- name: Create tags based on git data
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.env.ORG }}/${{ github.env.REPO }}/${{ github.env.PROJECT }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value={{sha}}
- name: login to github container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: build and push to ghcr.io
uses: docker/build-push-action@v5
with:
context: .
file: ./nosketchengine/Dockerfile
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true
_3:
needs: [noske_index]
uses: ${{ github.env.ORG }}/gl-autodevops-minimal-port/.github/workflows/deploy.yml@main
secrets: inherit
with:
DOCKER_TAG: ghcr.io/${{ github.env.ORG }}/${{ github.env.REPO }}/${{ github.env.PROJECT }}:latest
APP_NAME: "${{ github.env.PROJECT }}"
APP_ROOT: "/"
POSTGRES_ENABLED: false
environment: "${{ github.ref_name }}"
default_port: "8080"