fix(deps): update dependency isort to v6.0.1 (#626) #157
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: cloudflare-ddns | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- containers/cloudflare-ddns/** | |
- .github/workflows/cloudflare-ddns-docker-image.yml | |
pull_request: | |
branches: [ "mainline" ] | |
paths: | |
- containers/cloudflare-ddns/** | |
- .github/workflows/cloudflare-ddns-docker-image.yml | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./containers/cloudflare-ddns | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install .[dev] | |
- name: Run linting | |
run: | | |
black --check src tests | |
isort --check-only src tests | |
flake8 src tests | |
- name: Run tests | |
run: pytest --junitxml=reports/results.xml | |
- name: Archive test results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results | |
path: containers/cloudflare-ddns/reports/results.xml | |
package: | |
runs-on: ubuntu-latest | |
needs: build-and-test | |
if: success() && (github.event_name == 'pull_request' || github.ref == 'refs/heads/mainline') | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install cosign | |
if: github.event_name != 'pull_request' | |
uses: sigstore/cosign-installer@d7d6bc7722e3daa8354c50bcb52f4837da5e9b6a # v3.8.1 | |
with: | |
cosign-release: 'v2.1.1' | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3.9.0 | |
- name: Log into registry ${{ env.REGISTRY }} | |
if: github.event_name != 'pull_request' | |
uses: docker/#-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
id: build-and-push | |
uses: docker/build-push-action@0adf9959216b96bec444f325f1e493d4aa344497 # v6.14.0 | |
with: | |
context: containers/cloudflare-ddns | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ghcr.io/layertwo/cloudflare-ddns:latest | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Sign the published Docker image | |
if: ${{ github.event_name != 'pull_request' }} | |
env: | |
TAGS: ${{ steps.meta.outputs.tags }} | |
DIGEST: ${{ steps.build-and-push.outputs.digest }} | |
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} |