Skip to content

fix vitaes

fix vitaes #16

Workflow file for this run

name: renderer
on:
push:
branches: [ master ]
paths:
- 'renderer/**'
pull_request:
paths:
- 'renderer/**'
release:
types: [ published ]
env:
IMAGE_NAME: renderer
defaults:
run:
working-directory: ./renderer
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install -r requirements.txt
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: pytest
push:
needs: build
if: contains(github.ref, 'tags')
runs-on: ubuntu-latest
outputs:
version: ${{ steps.build_step.outputs.version }}
steps:
- uses: actions/checkout@v2
- name: Build image
id: build_step
run: |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
docker build -t vitaes/$IMAGE_NAME:latest .
docker tag vitaes/$IMAGE_NAME:latest vitaes/$IMAGE_NAME:$VERSION
- name: Login to Docker hub
run: |
echo ${{ secrets.DOCKER_HUB_PASSWORD }} | \
docker login -u ${{ secrets.DOCKER_HUB_USER }} --password-stdin
- name: Push image
run: |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
docker push vitaes/$IMAGE_NAME:latest
docker push vitaes/$IMAGE_NAME:$VERSION
- name: Logout from Docker hub
run: docker logout
deploy:
needs: push
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Setup kubeconfig
run: doctl kubernetes cluster kubeconfig save vitaes
- name: Rollout new container
run: |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
kubectl set image deployment/$IMAGE_NAME \
$IMAGE_NAME=vitaes/$IMAGE_NAME:$VERSION