Skip to content

Commit d372bc6

Browse files
author
Benjamin Wattie
committed
Initial commit
0 parents  commit d372bc6

3 files changed

Lines changed: 60 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build and publish python-static-analysis
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
10+
11+
jobs:
12+
13+
build_and_push_docker_image:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v2
22+
23+
- name: Log in to the Container registry
24+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
25+
with:
26+
registry: ${{ env.REGISTRY }}
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Extract metadata (tags, labels) for Docker
31+
id: meta
32+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
33+
with:
34+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35+
tags: |
36+
type=semver,pattern={{version}}
37+
type=semver,pattern={{major}}.{{minor}}
38+
- name: Build and push Docker image
39+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
40+
with:
41+
context: .
42+
push: true
43+
tags: ${{ steps.meta.outputs.tags }}
44+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM python:3.9-slim AS static-analysis
2+
3+
WORKDIR /project
4+
COPY requirements/static_analysis.txt requirements/static_analysis.txt
5+
RUN pip install -r requirements/static_analysis.txt
6+
COPY . /project

requirements/static_analysis.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
bandit~=1.7
2+
black
3+
flakehell
4+
# flakehell is incompatible with flake8==3.9.1
5+
flake8<3.9.1
6+
flake8-docstrings
7+
flake8-print
8+
flake8-spellcheck
9+
isort
10+
safety

0 commit comments

Comments
 (0)