Merge pull request #78 from RyGuy994/notes-enhance #32
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
name: Deploy to Docker | |
# Deploys data based off master branch | |
on: | |
push: | |
branches: [main] | |
jobs: | |
Mater_Setup: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.10.13 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Lint with flake8 and format | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
black . | |
# Mater_Testing: | |
# runs-on: ubuntu-latest | |
# needs: [Mater_Setup] | |
# if: success('Mater_Setup') | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Set up Python 3.10 | |
# uses: actions/setup-python@v2 | |
# with: | |
# python-version: 3.10.13 | |
# - name: Install dependencies | |
# run: | | |
# python -m pip install --upgrade pip | |
# if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi | |
# - name: Run tests | |
# run: | | |
# python -m unittest | |
Dockerizing: | |
runs-on: ubuntu-latest | |
needs: [Mater_Setup] | |
if: success('Mater_Setup') | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Docker Login | |
env: | |
DOCKER_USER: "${{ secrets.DOCKER_USER }}" | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
run: | | |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD | |
- name: Dockerize Mater | |
env: | |
DH_REPO: "${{ secrets.DH_REPO }}" | |
GITHUB_SHA: "${{ github.sha }}" | |
run: | | |
docker buildx build --tag $DH_REPO:$GITHUB_SHA -f ./prod.dockerfile . | |
- name: Docker push Mater | |
env: | |
DH_REPO: "${{ secrets.DH_REPO }}" | |
GITHUB_SHA: "${{ github.sha }}" | |
run: | | |
docker push $DH_REPO:$GITHUB_SHA |