chore(deps): bump the python-packages group across 1 directory with 2… #124
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: Release | |
on: | |
push: | |
branches: master | |
paths: | |
- '.github/workflows/release.yml' | |
- 'api/*.py' | |
- 'pyproject.toml' | |
- 'Dockerfile' | |
- 'requirements.txt' | |
jobs: | |
release: | |
if: | | |
github.actor != 'dependabot[bot]' && | |
github.actor != 'github-actions[bot]' && | |
github.actor != 'protected-auto-commits[bot]' | |
name: Release | |
runs-on: ubuntu-latest | |
concurrency: release | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- name: GitHub App Token | |
uses: actions/create-github-app-token@v1 | |
id: app-token | |
with: | |
app-id: ${{ secrets.APP_ID }} | |
private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ steps.app-token.outputs.token }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: "pip" | |
- name: Cache Dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install python-semantic-release | |
- name: Update to Latest Commit | |
run: | | |
git fetch origin | |
git rebase origin/master | |
- name: Semantic Release | |
id: github-release | |
uses: python-semantic-release/python-semantic-release@v9.12.0 | |
with: | |
github_token: ${{ steps.app-token.outputs.token }} | |
docker: | |
name: Docker | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
needs: release | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to Docker Hub | |
uses: docker/#-action@v3 | |
with: | |
username: ${{ vars.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Extract Docker Metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ vars.DOCKER_USERNAME }}/steam-stats | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=sha | |
- name: Build & Push Docker Image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
sbom: ${{ github.event_name != 'pull_request' }} | |
push: ${{ github.event_name != 'pull_request' }} | |
load: ${{ github.event_name == 'pull_request' }} | |
tags: | | |
${{ vars.DOCKER_USERNAME }}/steam-stats:latest | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
file: Dockerfile | |
- name: Docker Scout Scan | |
uses: docker/scout-action@v1.15.0 | |
with: | |
command: quickview, cves | |
image: ${{ vars.DOCKER_USERNAME }}/steam-stats:latest | |
to: ${{ vars.DOCKER_USERNAME }}/steam-stats:latest | |
only-severities: critical, high | |
only-fixed: true | |
write-comment: true | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
sarif-file: docker-scout-results.sarif | |
- name: Upload Scout Scan Results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docker-scout-results | |
path: docker-scout-results.sarif |