Skip to content

chore(deps): update docker/setup-buildx-action action to v3 (#57) #182

chore(deps): update docker/setup-buildx-action action to v3 (#57)

chore(deps): update docker/setup-buildx-action action to v3 (#57) #182

Workflow file for this run

name: ci
on:
push:
pull_request:
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: pip install black
- run: black --check --diff .
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: pip install pylama
- run: pylama packethardware setup.py
cli-test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "${{matrix.python-version}}"
- name: Basic cli test on Python ${{matrix.python-version}}
run: |
pip install .
packet-hardware --help
build-and-publish-docker-image:
name: build image and possibly push image to quay.io
runs-on: ubuntu-latest
needs:
- cli-test
- format
- lint
steps:
- uses: actions/checkout@v4
with:
lfs: 'true'
- uses: docker/setup-buildx-action@v3
id: buildx
- uses: docker/metadata-action@v5
id: meta
with:
images: quay.io/packet/packet-hardware
tags: |
type=ref,event=tag
type=sha
type=ref,event=branch
- uses: docker/login-action@v3
if: github.event_name == 'create' && github.event.ref_type == 'tag'
with:
registry: quay.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-cache
restore-keys: |
${{ runner.os }}-cache
- uses: docker/build-push-action@v5
with:
platforms: linux/amd64
push: ${{ github.event_name == 'create' && github.event.ref_type == 'tag' }}
tags: ${{ steps.meta.outputs.tags }}
context: '.'
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
builder: ${{ steps.buildx.outputs.name }}