Skip to content

Commit 2f5ffcf

Browse files
authored
Setup Dependabot & clean up build workflow (#5)
* Update actions * Setup Dependabot * Use linux arm64 runner * Update dependabot to bother less
1 parent 3e08595 commit 2f5ffcf

File tree

2 files changed

+45
-46
lines changed

2 files changed

+45
-46
lines changed

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "cargo"
9+
directory: "/"
10+
schedule:
11+
interval: "monthly"
12+
13+
- package-ecosystem: "github-actions"
14+
directory: "/"
15+
schedule:
16+
interval: "monthly"

.github/workflows/build.yml

Lines changed: 29 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,59 @@
1-
name: build
1+
name: Build
22

33
on:
44
workflow_dispatch:
55
push:
66
branches:
77
- "**"
8+
paths-ignore:
9+
- 'README.md'
810

911
env:
1012
REGISTRY: ghcr.io
1113
IMAGE_NAME: ${{ github.repository }}
1214

1315
jobs:
14-
build-x86:
15-
runs-on: ubuntu-latest
16+
build:
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- os: ubuntu-latest
23+
arch: amd64
24+
platform: linux/amd64
25+
- os: ubuntu-24.04-arm
26+
arch: arm64
27+
platform: linux/arm64
1628
permissions:
1729
contents: read
1830
packages: write
1931
steps:
20-
- uses: actions/checkout@v3
32+
- name: Prepare
33+
run: |
34+
platform=${{ matrix.platform }}
35+
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
36+
- uses: actions/checkout@v4
2137
- name: Log in to the Container registry
22-
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
38+
uses: docker/login-action@v3
2339
with:
2440
registry: ${{ env.REGISTRY }}
2541
username: ${{ github.actor }}
2642
password: ${{ secrets.GITHUB_TOKEN }}
27-
- name: Set up Docker Buildx
28-
uses: docker/setup-buildx-action@v2
29-
3043
- name: Extract metadata (tags, labels) for Docker
3144
id: meta
32-
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
45+
uses: docker/metadata-action@v5
3346
with:
3447
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35-
36-
- name: Build and push Docker image
37-
uses: docker/build-push-action@v4
38-
with:
39-
context: .
40-
platforms: linux/amd64
41-
push: true
42-
tags: ${{ steps.meta.outputs.tags }}
43-
labels: ${{ steps.meta.outputs.labels }}
44-
45-
build-arm:
46-
runs-on: ubuntu-latest
47-
permissions:
48-
contents: read
49-
packages: write
50-
steps:
51-
- uses: actions/checkout@v3
52-
- name: Log in to the Container registry
53-
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
54-
with:
55-
registry: ${{ env.REGISTRY }}
56-
username: ${{ github.actor }}
57-
password: ${{ secrets.GITHUB_TOKEN }}
58-
- name: Set up QEMU
59-
uses: docker/setup-qemu-action@v3
6048
- name: Set up Docker Buildx
61-
uses: docker/setup-buildx-action@v2
62-
63-
- name: Extract metadata (tags, labels) for Docker
64-
id: meta
65-
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
66-
with:
67-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
68-
49+
uses: docker/setup-buildx-action@v3
6950
- name: Build and push Docker image
70-
uses: docker/build-push-action@v4
51+
uses: docker/build-push-action@v6
7152
with:
7253
context: .
73-
platforms: linux/arm64
54+
platforms: ${{ matrix.platform }}
7455
push: true
75-
tags: ${{ steps.meta.outputs.tags }}-arm64
76-
labels: ${{ steps.meta.outputs.labels }}-arm64
56+
tags: ${{ steps.meta.outputs.tags }}-${{ env.PLATFORM_PAIR }}
57+
labels: ${{ steps.meta.outputs.labels }}-${{ env.PLATFORM_PAIR }}
58+
cache-from: type=gha
59+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)