chore: add logging when init of clients are done #27
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: CI/CD Workflow | |
on: | |
release: | |
types: [published] | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
# Hostname of your registry | |
REGISTRY: docker.io | |
# Image repository, without hostname and tag | |
IMAGE_NAME: ${{ github.repository }} | |
#SHA: ${{ github.event.pull_request.head.sha || github.event.after }} | |
jobs: | |
lint: | |
name: Lint Python code | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install black | |
- name: Lint Python code | |
run: black --check . | |
sast_scan: | |
name: SAST Bandit Scan | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install bandit | |
- name: SAST Bandit Scan | |
run: bandit -ll -ii -r . -f json -o bandit-report.json | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: bandit-findings | |
path: bandit-report.json | |
image_scan: | |
name: Image Scout Scan | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Docker | |
uses: docker-practice/actions-setup-docker@v1 | |
with: | |
docker_version: "24.0" | |
- name: Build Docker image | |
run: docker build -f Dockerfile -t sync-fitbit-pro-connect:latest . | |
- name: Authenticate to registry ${{ env.REGISTRY }} | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ secrets.DOCKER_HUB_USER}} | |
password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
- name: Docker Scout Scan | |
uses: docker/scout-action@v1 | |
with: | |
command: quickview, cves | |
only-severities: high, critical | |
sarif-file: scout-report.sarif | |
exit-code: true | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: docker-scout-findings | |
path: scout-report.sarif | |
push_to_registry: | |
name: Push Docker image to Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | |
with: | |
username: ${{ secrets.DOCKER_HUB_USER }} | |
password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | |
with: | |
images: origox/sync-fitbit-pro-connect | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=sha | |
type=raw,value=latest | |
- name: Build and push Docker image | |
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |