👷 Update Docker build action #19
Workflow file for this run
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: Docker Image CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Install toml-cli | |
run: pip install toml | |
- name: Get version from pyproject.toml | |
id: get_version | |
run: echo "VERSION=$(toml get backend/pyproject.toml tool.poetry.version)" >> $GITHUB_ENV | |
- name: Docker Login | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKERACC }} | |
password: ${{ secrets.DOCKERPWD }} | |
- name: Build and push Docker images | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ${{ secrets.REGISTRY }}:latest, ${{ secrets.REGISTRY }}:${{ env.VERSION }} | |