Skip to content

Commit db39a67

Browse files
authored
fix: Modernize CI (#2487)
1 parent 799f316 commit db39a67

File tree

3 files changed

+39
-26
lines changed

3 files changed

+39
-26
lines changed

.github/workflows/docker-push.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
name: Build Docker container on push
22

33
on:
4-
push:
5-
branches:
6-
- "*"
4+
push:
5+
branches:
6+
- "*"
77

88
jobs:
99
build:
1010
name: Build image
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-24.04
12+
13+
permissions:
14+
contents: read
15+
packages: write
16+
id-token: write
1217

1318
steps:
1419
- name: Checkout project
15-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
1621

1722
- name: Set env variables
1823
run: |
@@ -21,23 +26,25 @@ jobs:
2126
echo "IMAGE_NAME=${REPO_OWNER,,}/${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
2227
2328
- name: Login to GitHub Container Registry
24-
uses: docker/login-action@v1
29+
uses: docker/login-action@v3
2530
with:
2631
registry: ghcr.io
2732
username: ${{ github.repository_owner }}
2833
password: ${{ secrets.GITHUB_TOKEN }}
2934

3035
- name: Set up QEMU
31-
uses: docker/setup-qemu-action@v2
36+
uses: docker/setup-qemu-action@v3
3237
id: qemu
3338

3439
- name: Setup Docker buildx action
35-
uses: docker/setup-buildx-action@v2
40+
uses: docker/setup-buildx-action@v3
3641
id: buildx
3742

3843
- name: Run Docker buildx
3944
run: |
40-
docker buildx build \
41-
--platform linux/amd64,linux/arm64 \
42-
--tag ghcr.io/$IMAGE_NAME:$BRANCH \
43-
--output "type=registry" ./
45+
docker buildx build \
46+
--platform linux/amd64,linux/arm64 \
47+
--tag ghcr.io/$IMAGE_NAME:$BRANCH \
48+
--cache-from type=gha \
49+
--cache-to type=gha,mode=max \
50+
--output "type=registry" ./

.github/workflows/docker-tag.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ on:
99
jobs:
1010
build:
1111
name: Build image
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-24.04
1313

1414
steps:
1515
- name: Checkout project
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v4
1717

1818
- name: Set env variables
1919
run: |
@@ -22,21 +22,23 @@ jobs:
2222
echo "IMAGE_NAME=${REPO_OWNER,,}/${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
2323
2424
- name: Login to GitHub Container Registry
25-
uses: docker/login-action@v1
25+
uses: docker/login-action@v3
2626
with:
2727
registry: ghcr.io
2828
username: ${{ github.repository_owner }}
2929
password: ${{ secrets.GITHUB_TOKEN }}
3030

3131
- name: Set up QEMU
32-
uses: docker/setup-qemu-action@v1
32+
uses: docker/setup-qemu-action@v3
3333

3434
- name: Setup Docker buildx action
35-
uses: docker/setup-buildx-action@v1
35+
uses: docker/setup-buildx-action@v3
3636

3737
- name: Run Docker buildx
3838
run: |
39-
docker buildx build \
40-
--platform linux/amd64,linux/arm64 \
41-
--tag ghcr.io/$IMAGE_NAME:$TAG \
42-
--output "type=registry" ./
39+
docker buildx build \
40+
--platform linux/amd64,linux/arm64 \
41+
--tag ghcr.io/$IMAGE_NAME:$TAG \
42+
--cache-from type=gha \
43+
--cache-to type=gha,mode=max \
44+
--output "type=registry" ./

Dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,29 @@
99
ARG USER=specter
1010
ARG DIR=/data/
1111

12-
FROM python:3.10-slim-bullseye AS builder
12+
FROM python:3.10-bookworm AS builder
1313

1414
ARG VERSION
1515
ARG REPO
1616

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

1919
WORKDIR /
2020

2121
WORKDIR /specter-desktop
2222

23-
COPY . .
23+
COPY requirements.txt .
2424

2525
RUN pip3 install --upgrade pip
2626
RUN pip3 install babel cryptography
27-
RUN pip3 install .
27+
RUN pip3 install -r requirements.txt
28+
29+
COPY . .
30+
31+
RUN pip3 install . --no-deps
2832

2933

30-
FROM python:3.10-slim-bullseye as final
34+
FROM python:3.10-slim-bookworm as final
3135

3236
ARG USER
3337
ARG DIR

0 commit comments

Comments
 (0)