-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2021 updates to default branch
- Loading branch information
Showing
16 changed files
with
750 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- dev | ||
push: | ||
branches: | ||
- master | ||
- dev | ||
|
||
jobs: | ||
linting: | ||
name: Linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-${{ env.pythonLocation }}-pip-${{ hashFiles('**/vaalilakanabot2021.py') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ env.pythonLocation }}-pip- | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt && pip install pylint | ||
- name: Run pylint | ||
run: pylint vaalilakanabot2021.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Publish Docker image | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- dev | ||
tags: | ||
- v* | ||
pull_request: | ||
branches: | ||
- master | ||
- dev | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push: | ||
name: Build and push image | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*.env | ||
|
||
# Exclude all but example logs | ||
logs/* | ||
!example* | ||
|
||
#Exclude all but example data | ||
data/* | ||
!example* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[BASIC] | ||
argument-rgx=[a-z_][a-z0-9_]{0,30} | ||
attr-rgx=[a-z_][a-z0-9_]{0,30} | ||
const-rgx=[a-zA-Z_][a-zA-Z0-9_]{0,30} | ||
variable-rgx=[a-zA-Z_][a-zA-Z0-9_]{0,30} | ||
|
||
[FORMAT] | ||
max-line-length=120 | ||
|
||
[MESSAGES CONTROL] | ||
disable= | ||
arguments-differ, | ||
broad-except, | ||
consider-using-f-string, | ||
fixme, | ||
global-statement, | ||
missing-class-docstring, | ||
missing-final-newline, | ||
missing-function-docstring, | ||
missing-module-docstring, | ||
no-else-return, | ||
too-few-public-methods, | ||
too-many-arguments, | ||
too-many-boolean-expressions, | ||
too-many-branches, | ||
too-many-format-args, | ||
too-many-instance-attributes, | ||
too-many-locals, | ||
too-many-nested-blocks, | ||
too-many-return-statements, | ||
too-many-statements, | ||
unspecified-encoding, | ||
unused-argument, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM python:3.9-slim | ||
|
||
LABEL version="2021" \ | ||
description="Vaalilakanabot" \ | ||
org.opencontainers.image.source="https://github.com/fyysikkokilta/vaalilakanabot" | ||
|
||
WORKDIR /bot | ||
COPY requirements.txt requirements.txt | ||
RUN pip install -r requirements.txt | ||
|
||
COPY assets ./assets | ||
COPY vaalilakanabot2021.py vaalilakanabot2021.py | ||
|
||
CMD ["python3", "vaalilakanabot2021.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"Puheenjohtaja": [{"name": "Patrik Lahti", "position": "Puheenjohtaja", "fiirumi": "https://fiirumi.fyysikkokilta.fi/t/patrik-lahti-puheenjohtajaksi-2020-for-president-2020/59", "valittu": true}], "Varapuheenjohtaja": [], "Rahastonhoitaja": [], "Fuksikapteeni": [], "IE": [], "Hupimestari": [], "Viestint\u00e4vastaava": [], "Kv-vastaava": [], "Yrityssuhdevastaava": [], "Opintovastaava": []} | ||
{"Puheenjohtaja": [{"name": "Patrik Lahti", "position": "Puheenjohtaja", "fiirumi": "https://fiirumi.fyysikkokilta.fi/t/patrik-lahti-puheenjohtajaksi-2020-for-president-2020/59", "valittu": true}], "Varapuheenjohtaja": [], "Rahastonhoitaja": [], "Fuksikapteeni": [], "IE": [], "Hupimestari": [], "Viestint\u00e4vastaava": [], "Kv-vastaava": [], "Yrityssuhdevastaava": [], "Opintovastaava": [], "ISOvastaava": [], "Jatkuvuustoimikunnan puheenjohtaja": [], "Excumestari": [], "Lukkarimestari": [], "Kvantin p\u00e4\u00e4toimittaja": []} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
version: '3.4' | ||
services: | ||
bot: | ||
build: . | ||
image: ghcr.io/fyysikkokilta/vaalilakanabot:master | ||
volumes: | ||
- ./data:/bot/data:rw | ||
- ./logs:/bot/logs:rw | ||
env_file: | ||
- bot.env | ||
profiles: | ||
- prod | ||
|
||
dev-bot: | ||
build: . | ||
image: ghcr.io/fyysikkokilta/vaalilakanabot:dev | ||
volumes: | ||
- ./data:/bot/data:rw | ||
- ./logs:/bot/logs:rw | ||
env_file: | ||
- bot.env | ||
profiles: | ||
- dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2021-10-02 16:16:58,056 - vaalilakanabot - INFO - Loaded channels: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
python-telegram-bot | ||
requests | ||
lxml |
Oops, something went wrong.