Skip to content

Commit

Permalink
Added GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Chelsea486MHz committed Jan 4, 2024
1 parent ef40da1 commit 7b6d952
Show file tree
Hide file tree
Showing 2 changed files with 144 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/compute.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: compute

on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'

jobs:
flake8:
runs-on: ubuntu-latest
steps:
- name: Check out source repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r compute/requirements.txt
pip install flake8
- name: Lint with flake8
run: |
flake8 compute/*.py
bandit:
runs-on: ubuntu-latest
steps:
- name: Check out source repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r compute/requirements.txt
pip install bandit
- name: Run bandit
run: |
bandit -r compute/*.py || true
publish:
needs: [flake8, bandit]
runs-on: ubuntu-latest
steps:
- name: Check out source repository
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: chelsea486mhz
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:compute"
push: true
tags: chelsea486mhz/stargazer-compute:latest
72 changes: 72 additions & 0 deletions .github/workflows/manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: manager

on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'

jobs:
flake8:
runs-on: ubuntu-latest
steps:
- name: Check out source repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r manager/requirements.txt
pip install flake8
- name: Lint with flake8
run: |
flake8 manager/*.py
bandit:
runs-on: ubuntu-latest
steps:
- name: Check out source repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r manager/requirements.txt
pip install bandit
- name: Run bandit
run: |
bandit -r manager/*.py || true
publish:
needs: [flake8, bandit]
runs-on: ubuntu-latest
steps:
- name: Check out source repository
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: chelsea486mhz
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:manager"
push: true
tags: chelsea486mhz/stargazer-manager:latest

0 comments on commit 7b6d952

Please sign in to comment.