Skip to content

Merge pull request #2 from fu/fix/add_multi_support #10

Merge pull request #2 from fu/fix/add_multi_support

Merge pull request #2 from fu/fix/add_multi_support #10

name: Build and Push Docker image
on:
push:
tags:
- "v*" # Trigger workflow only on tags that start with 'v'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install hatch
run: pip install hatch
- name: Extract version using Hatch
id: get_version
run: echo "VERSION=$(hatch version)" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: |
zerealfu/fass:${{ env.VERSION }}
zerealfu/fass:latest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}