Skip to content

Fix getting of branch name #10

Fix getting of branch name

Fix getting of branch name #10

Workflow file for this run

name: Build
on:
push:
branches: [ main ]
tags:
- v*
pull_request:
types: [ opened, reopened ]
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.9 ]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Build server_info, ssl certs
run: |
./generate-ssl-certs.sh
./generate-server-info.sh
- name: Test with pytest
run: |
pytest
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ github.repository_owner }}/${{ github.event.repository.name }}
- name: Log in to Docker Hub
if: ${{ github.event.repository.name == 'flask-app-example' && github.event_name != 'pull_request' }}
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event.repository.name == 'flask-app-example' && github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}