Skip to content

1.0.0 - Flask w/ SQLAlchemy #2

1.0.0 - Flask w/ SQLAlchemy

1.0.0 - Flask w/ SQLAlchemy #2

Workflow file for this run

name: Release Package
on:
release:
types: [published]
workflow_dispatch:
jobs:
check-version:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Library
run: python -m pip install app/sample_registry/
- id: get_version
uses: battila7/get-version-action@v2
- name: Check version
run: |
LIBRARY_VERSION=$(sample_registry_version > /dev/null)
GITHUB_VERSION=${{ steps.get_version.outputs.version-without-v }}
if [[ $LIBRARY_VERSION == $GITHUB_VERSION ]]; then
echo "Versions match, continuing..."
else
echo "Versions don't match, exiting..."
echo "Library version: $LIBRARY_VERSION"
echo "GitHub version: $GITHUB_VERSION"
exit 1
fi
run-tests:
uses: ./.github/workflows/test.yml
secrets: inherit
needs: check-version
build-and-push-to-dockerhub:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
needs: run-tests
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ctbushman/sample_registry
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}