Skip to content

Update github package permissions #45

Update github package permissions

Update github package permissions #45

Workflow file for this run

name: Build traffcap
on:
push:
branches: ["master"]
tags: ['*']
pull_request:
branches: ["master"]
permissions:
contents: read
packages: write
attestations: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install dependencies
run: |
curl -sSL https://pdm.fming.dev/install-pdm.py | python3 -
pdm install
- name: Lint with Ruff
run: pdm run lint
- name: Test with pytest
run: pdm run test
push_to_docker_hub:
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@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: centurix/traffcap:latest
push_to_ghcr:
name: Push Docker image to GHCR
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: centurix/traffcap:latest