Skip to content

update env store of tag #28

update env store of tag

update env store of tag #28

name: Build and push docker image
on:
push:
branches:
- main
- ninabernick/semver
workflow_dispatch:
jobs:
build-and-push:
name: Build and push docker image
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12'
- name: install poetry
run: |
python -m pip install --no-cache-dir poetry==1.8 supervisor
- name: set up docker
run: |
make gha-setup
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build with Poetry
run: make build-wheel
- name: Release Please Action
id: release
uses: google-github-actions/release-please-action@v4
with:
release-type: simple
token: ${{ secrets.GITHUB_TOKEN }}
- name: Determine Docker tag
id: docker_tag
run: |
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
echo "tag=${{ steps.release.outputs.version }}" >> $GITHUB_ENV
else
echo "tag=latest" >> $GITHUB_ENV
fi
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}-test:${{ env.tag }}