-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (64 loc) · 2.29 KB
/
python-app.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.12.1
uses: actions/setup-python@v3
with:
python-version: "3.12.1"
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Build (develop)
if: ${{ github.ref == 'refs/heads/develop' || github.event.debug }}
run: python unity_changelog_scraper.py --no-full-set --output-folder output --print-versions --max-scrapes 6
- name: Build (master/pr's)
if: ${{ github.ref != 'refs/heads/develop' && !github.event.debug }}
run: python unity_changelog_scraper.py --output-folder output
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: changelogs-output
path: ./output
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: changelogs-output
path: ./output
- name: Mongo import files
# You may pin to the exact commit or the version.
uses: eamonwoortman/mongo-import-action@0.1
with:
# A file, directory or wildcard pattern that describes what to upload
path: './output'
# MongoDB connection string
uri: '${{ secrets.MONGODB_URI }}'
# Database name
database: '${{ secrets.MONGODB_DATABASE }}'
# Collection name
collection: '${{ secrets.MONGODB_COLLECTION }}'
# Do not clear the collection before importing new files.
keep-collection: false
if-no-files-found: error