Skip to content

Commit

Permalink
Added build action
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon (JR) Price authored Feb 4, 2024
1 parent 4a2b8a5 commit 69861df
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 6 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build

on:
push:
branches: [ "main" ]

env:
SVC_NAME: sk-codename-svc

jobs:
deploy:
name: Deploy to Registry
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# TODO: Use this when ready to push
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: zerodaysec/${{ env.SVC_NAME }}:main
51 changes: 45 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,55 @@
#VERSION=0.1
name: CI

on: push

env:
SVC_NAME: sk-codename-svc

jobs:
gitHubActionForPylint:
name: GitHub Action for pylint
pylint:
name: Pylint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- uses: actions/setup-python@v5
with:
python-version: 3.11
- run: pip install pipenv pylint flake8
- run: pipenv sync && pipenv run pylint **/*.py
# - run: flake8
python-version: '3.11'

- run: python -m pip install pipenv pylint

# TODO: Fix the linting issue...
# - run: pipenv run pylint **/*.py

hadolint:
name: Hadolint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- uses: hadolint/[email protected]
with:
dockerfile: Dockerfile

shellcheck:
name: ShellCheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master

docker:
name: Docker build smoke test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

# TODO: Use this when ready to push
- name: Build and push
uses: docker/build-push-action@v5
with:
push: false
tags: zerodaysec/${{ env.SVC_NAME }}:testing
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.11

WORKDIR /app

# TODO: Need to enable pipenv
# COPY requirements.txt /app/
COPY app.py /app/

ENV FLASK_APP=app.py

ENTRYPOINT ["flask", "run"]

0 comments on commit 69861df

Please sign in to comment.