Skip to content

feat: update Docker workflow to include DockerHub login #10

feat: update Docker workflow to include DockerHub login

feat: update Docker workflow to include DockerHub login #10

Workflow file for this run

name: UV - Release
on:
push:
branches:
- main
jobs:
Semantic-Release:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.release.outputs.tag }}
concurrency:
group: ${{ github.workflow }}-release-${{ github.ref_name }}
cancel-in-progress: false
permissions:
contents: write
env:
dist_artifacts_name: dist
dist_artifacts_dir: dist
lock_file_artifact: uv.lock
UV_VERSION: '0.9.28'
PYTHON_VERSION: '3.13'
GITHUB_ACTIONS_AUTHOR_NAME: github-actions
GITHUB_ACTIONS_AUTHOR_EMAIL: actions@users.noreply.github.com
steps:
- name: Setup | Checkout Repository on Release Branch
uses: actions/checkout@v6
with:
ref: ${{ github.ref_name }}
- name: Setup | Force release branch to be at workflow sha
run: |
git reset --hard ${{ github.sha }}
- name: Restore global uv cache
id: cache-restore
uses: actions/cache/restore@v5
with:
path: |
~/.cache/uv
~/.local/share/uv
.venv
key: uv-main-${{ env.UV_VERSION }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('pyproject.toml', 'uv.lock') }}
restore-keys: |
uv-main-
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: ${{ env.UV_VERSION }}
python-version: ${{ env.PYTHON_VERSION }}
enable-cache: false
- name: Action | Semantic Version Release
id: release
uses: python-semantic-release/python-semantic-release@v10.5.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
git_committer_name: 'github-actions'
git_committer_email: 'actions@users.noreply.github.com'
- name: Publish | Upload to GitHub Release Assets
uses: python-semantic-release/publish-action@v10.5.3
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.release.outputs.tag }}
- name: Save uv caches
if: steps.cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v5
with:
path: |
~/.cache/uv
~/.local/share/uv
.venv
key: uv-main-${{ env.UV_VERSION }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('pyproject.toml', 'uv.lock') }}
docker-build-and-scan:
needs: Semantic-Release
uses: milsman2/python-app-template/.github/workflows/docker-build-and-scan.yaml@main
secrets: inherit
with:
DOCKER_PATH_CONTEXT: .
DOCKER_BUILD_DOCKERFILE: Dockerfile
DOCKER_LOAD_BOOL: true
DOCKER_TAGS: milsman2/sample-python-app:${{ needs.Semantic-Release.outputs.tag }}