-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5bd7946
Showing
13 changed files
with
794 additions
and
0 deletions.
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,4 @@ | ||
WAKATIME_JSON= | ||
GH_TOKEN= | ||
GH_ACTOR= | ||
|
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,46 @@ | ||
name: Create and publish a Docker image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*.*.*' | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
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,48 @@ | ||
name: Run Github Activity Action | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
months: | ||
type: choice | ||
description: 'number of months to generate' | ||
options: | ||
- "1" | ||
- "2" | ||
- "3" | ||
- "6" | ||
- "12" | ||
- "24" | ||
|
||
# schedule: | ||
# - cron: '0 0,12,18 * * *' | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
generate-and-publish-svg: | ||
name: Generate Activity SVGs and Publish to Github Pages | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: "Run Github Activity SVG Action" | ||
uses: rehborn/github-activity-svg@v1 | ||
with: | ||
months: ${{ inputs.months || '3' }} | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GH_ACTOR: ${{ github.actor }} | ||
WAKATIME_JSON_URL: ${{ secrets.WAKATIME_JSON_URL }} | ||
|
||
- name: Upload Web artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: ./dist/ | ||
|
||
- name: Deploying Web artifact | ||
uses: actions/deploy-pages@v2 |
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,46 @@ | ||
name: Python Lint and Test | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: ['3.10'] | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pipenv | ||
pipenv install -d --deploy | ||
- name: Run Linter | ||
run: | | ||
{ | ||
echo 'MESSAGE<<EOF' | ||
pipenv run pylint main.py --exit-zero | ||
echo EOF | ||
} >> "$GITHUB_ENV" | ||
# Post Results to PR only on pull_request | ||
- name: Post result to PR | ||
if: github.event_name == 'pull_request' | ||
uses: mshick/add-pr-comment@v2 | ||
with: | ||
message: ${{ env.MESSAGE }} |
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,2 @@ | ||
.env | ||
dist/ |
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,20 @@ | ||
FROM python:3.10-slim | ||
|
||
ENV PYTHONUNBUFFERED 1 | ||
|
||
# pipenv working directory | ||
ENV WORKON_HOME /root | ||
ENV PIPENV_PIPFILE /app/Pipfile | ||
|
||
COPY Pipfile Pipfile.lock main.py /app/ | ||
|
||
WORKDIR /app | ||
|
||
RUN pip install pipenv | ||
RUN pipenv install --deploy | ||
|
||
EXPOSE 8000 | ||
|
||
ENV WORK_DIR /data | ||
|
||
ENTRYPOINT ["pipenv", "run", "python", "/app/main.py", "--work-dir", "${WORK_DIR}"] |
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,16 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
drawsvg = "*" | ||
requests = "*" | ||
python-dotenv = "*" | ||
python-dateutil = "*" | ||
|
||
[dev-packages] | ||
|
||
[requires] | ||
python_version = "3.10" | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.