Skip to content

Merge pull request #339 from comtihon/dependabot/pip/sphinx-7.0.1 #150

Merge pull request #339 from comtihon/dependabot/pip/sphinx-7.0.1

Merge pull request #339 from comtihon/dependabot/pip/sphinx-7.0.1 #150

name: Docker
on:
push:
branches: [ master ]
env:
IMAGE_NAME: catcher-core
jobs:
# Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: false
push:
# Ensure test job passes before pushing image.
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
# Get tag from python code
- name: Get current version
run: echo "::set-output name=TAG::$(cat catcher/__init__.py | grep -oP '(\d+\.)(\d+\.)(\*|\d+)')"
id: get-tag
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
comtihon/catcher_base:latest
comtihon/catcher_base:${{ steps.get-tag.outputs.TAG }}
ghcr.io/comtihon/catcher-core:latest
ghcr.io/comtihon/catcher-core:${{ steps.get-tag.outputs.TAG }}