Skip to content

Commit

Permalink
fix: Modernize CI (#2487)
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronDewes authored Jan 3, 2025
1 parent 799f316 commit db39a67
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 26 deletions.
31 changes: 19 additions & 12 deletions .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
name: Build Docker container on push

on:
push:
branches:
- "*"
push:
branches:
- "*"

jobs:
build:
name: Build image
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

permissions:
contents: read
packages: write
id-token: write

steps:
- name: Checkout project
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set env variables
run: |
Expand All @@ -21,23 +26,25 @@ jobs:
echo "IMAGE_NAME=${REPO_OWNER,,}/${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
id: qemu

- name: Setup Docker buildx action
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
id: buildx

- name: Run Docker buildx
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag ghcr.io/$IMAGE_NAME:$BRANCH \
--output "type=registry" ./
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag ghcr.io/$IMAGE_NAME:$BRANCH \
--cache-from type=gha \
--cache-to type=gha,mode=max \
--output "type=registry" ./
20 changes: 11 additions & 9 deletions .github/workflows/docker-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ on:
jobs:
build:
name: Build image
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- name: Checkout project
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set env variables
run: |
Expand All @@ -22,21 +22,23 @@ jobs:
echo "IMAGE_NAME=${REPO_OWNER,,}/${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3

- name: Setup Docker buildx action
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Run Docker buildx
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag ghcr.io/$IMAGE_NAME:$TAG \
--output "type=registry" ./
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag ghcr.io/$IMAGE_NAME:$TAG \
--cache-from type=gha \
--cache-to type=gha,mode=max \
--output "type=registry" ./
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,29 @@
ARG USER=specter
ARG DIR=/data/

FROM python:3.10-slim-bullseye AS builder
FROM python:3.10-bookworm AS builder

ARG VERSION
ARG REPO

RUN apt update && apt install -y git build-essential libusb-1.0-0-dev libudev-dev libffi-dev libssl-dev rustc cargo libpq-dev
RUN apt update && apt install -y git libusb-1.0-0-dev libudev-dev libffi-dev libssl-dev rustc cargo libpq-dev

WORKDIR /

WORKDIR /specter-desktop

COPY . .
COPY requirements.txt .

RUN pip3 install --upgrade pip
RUN pip3 install babel cryptography
RUN pip3 install .
RUN pip3 install -r requirements.txt

COPY . .

RUN pip3 install . --no-deps


FROM python:3.10-slim-bullseye as final
FROM python:3.10-slim-bookworm as final

ARG USER
ARG DIR
Expand Down

0 comments on commit db39a67

Please sign in to comment.