-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (38 loc) · 1.29 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
name: Docker image build and push to gcp
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Create .env file
run: |
echo "MEDIUM_ACCESS_TOKEN=${{ secrets.MEDIUM_ACCESS_TOKEN }}" >> .env
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME }}" >> .env
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> .env
echo "DEBUG=${{ secrets.DEBUG }}" >> .env
shell: bash
- name: Set up Google Credentials
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ runner.temp }}/credential/gcloud.json
run: |
echo "${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}" > $GOOGLE_APPLICATION_CREDENTIALS
shell: bash
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
shell: bash
- name: Install dependencies
run: poetry install
- name: Run tests or other commands
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ runner.temp }}/credential/gcloud.json
run: poetry run python main.py --topics ${{ secrets.TOPICS }}