Skip to content

Commit

Permalink
Merge pull request #12 from zaanposni/9-add-pr-checks-and-build-image…
Browse files Browse the repository at this point in the history
…s-in-github-actions

9 add pr checks and build images in github actions
  • Loading branch information
zaanposni authored Jan 21, 2024
2 parents f94a8e9 + fc8d37a commit 8694c96
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @zaanposni
23 changes: 23 additions & 0 deletions .github/workflows/docker_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Docker

on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Build frontend
working-directory: ./src/psaggregator
run: docker build -t ghcr.io/${{ github.repository_owner }}/psaggregator_frontend:latest .

- name: Build nginx
working-directory: ./src/nginx
run: docker build -t ghcr.io/${{ github.repository_owner }}/psaggregator_nginx:latest .

- name: Build dataimport
working-directory: ./src/dataimport
run: docker build -t ghcr.io/${{ github.repository_owner }}/psaggregator_dataimport:latest .
42 changes: 42 additions & 0 deletions .github/workflows/docker_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: DockerPublish

on:
push:
branches:
- "master"

jobs:
DockerPublish:
if: github.repository_owner == 'zaanposni'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Determine version
run: |
VERSION=$(cat ./src/psaggregator/package.json | jq -r '.version')
echo "I found version: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build frontend
working-directory: ./src/psaggregator
run: docker build -t ghcr.io/${{ github.repository_owner }}/psaggregator_frontend:latest -t ghcr.io/${{ github.repository_owner }}/psaggregator_frontend:${{ env.VERSION }} .

- name: Build nginx
working-directory: ./src/nginx
run: docker build -t ghcr.io/${{ github.repository_owner }}/psaggregator_nginx:latest -t ghcr.io/${{ github.repository_owner }}/psaggregator_nginx:${{ env.VERSION }} .

- name: Build dataimport
working-directory: ./src/dataimport
run: docker build -t ghcr.io/${{ github.repository_owner }}/psaggregator_dataimport:latest -t ghcr.io/${{ github.repository_owner }}/psaggregator_dataimport:${{ env.VERSION }} .

- name: Push images
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u zaanposni --password-stdin
docker push ghcr.io/${{ github.repository_owner }}/psaggregator_frontend:${{ env.VERSION }}
docker push ghcr.io/${{ github.repository_owner }}/psaggregator_nginx:${{ env.VERSION }}
docker push ghcr.io/${{ github.repository_owner }}/psaggregator_dataimport:${{ env.VERSION }}
docker push ghcr.io/${{ github.repository_owner }}/psaggregator_frontend:latest
docker push ghcr.io/${{ github.repository_owner }}/psaggregator_nginx:latest
docker push ghcr.io/${{ github.repository_owner }}/psaggregator_dataimport:latest
28 changes: 28 additions & 0 deletions .github/workflows/pythonlint_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Python

on:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"

- name: Install dependencies
working-directory: ./src/dataimport
run: |
python -m pip install --upgrade pip
pip install pylint
pip install -r requirements.txt
- name: Lint Python code
working-directory: ./src/dataimport
run: |
pylint --errors-only ./*.py
5 changes: 1 addition & 4 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@

## Supported Versions

psaggregator currently has no major release.
However, once Version `1.0.0` is released, it will be supported as a LTS.

| Version | Supported |
| ------- | ------------------ |
| 1.x.x | :white_check_mark: |
| 0.x.x | :x: |

## Reporting a Vulnerability

Please report severe vulnerabilities via mail at psaggregator-vul@zaanposni.com
Please report severe vulnerabilities via mail at <psaggregator-vul@zaanposni.com>
12 changes: 3 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ services:
frontend:
container_name: psaggregator_frontend
restart: unless-stopped
build:
context: ./src/psaggregator
dockerfile: Dockerfile
image: ghcr.io/zaanposni/psaggregator_frontend:latest
environment:
- PRIVATE_DATABASE_URL=${DATABASE_URL}
- PUBLIC_LEGAL_URL=${LEGAL_URL}
Expand All @@ -35,9 +33,7 @@ services:
dataimport:
container_name: psaggregator_dataimport
restart: unless-stopped
build:
context: ./src/dataimport
dockerfile: Dockerfile
image: ghcr.io/zaanposni/psaggregator_dataimport:latest
environment:
- DATABASE_URL=${DATABASE_URL}
- REDDIT_CLIENT_ID=${REDDIT_CLIENT_ID}
Expand All @@ -54,9 +50,7 @@ services:
nginx:
container_name: psaggregator_nginx
restart: unless-stopped
build:
context: ./src/nginx
dockerfile: Dockerfile
image: ghcr.io/zaanposni/psaggregator_nginx:latest
depends_on:
- frontend
ports:
Expand Down
2 changes: 1 addition & 1 deletion src/psaggregator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "psaggregator",
"version": "0.0.1",
"version": "1.0.0",
"scripts": {
"dev": "vite dev",
"build": "vite build",
Expand Down

0 comments on commit 8694c96

Please sign in to comment.