Skip to content

Commit 9494fd5

Browse files
committed
chore: use depot ci
1 parent 73cd7b1 commit 9494fd5

2 files changed

Lines changed: 173 additions & 80 deletions

File tree

.depot/workflows/build.yaml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Depot CI Migration
2+
# Source: .github/workflows/build.yaml
3+
#
4+
# Changes made:
5+
# - Changed GitHub runs-on labels to their Depot equivalents
6+
7+
name: build
8+
on:
9+
pull_request:
10+
push:
11+
branches:
12+
- main
13+
tags:
14+
- "v*"
15+
workflow_dispatch:
16+
permissions:
17+
artifact-metadata: write
18+
attestations: write
19+
contents: read
20+
packages: write
21+
id-token: write
22+
env:
23+
IMAGE_NAME: ghcr.io/getarcaneapp/tools
24+
PUBLISH_PLATFORMS: linux/amd64,linux/386,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
25+
jobs:
26+
validate:
27+
runs-on: depot-ubuntu-latest # was: ubuntu-latest. Mapped standard GitHub runner to Depot equivalent.
28+
steps:
29+
- name: Check out repository
30+
uses: actions/checkout@v6
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v4
33+
- name: Build validation image
34+
uses: docker/build-push-action@v7
35+
with:
36+
context: .
37+
load: true
38+
platforms: linux/amd64
39+
tags: arcane-toolbox:ci
40+
- name: Validate runtime contract
41+
run: ./scripts/validate.sh arcane-toolbox:ci
42+
publish:
43+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
44+
needs: validate
45+
runs-on: depot-ubuntu-latest
46+
steps:
47+
- name: Check out repository
48+
uses: actions/checkout@v6
49+
- name: Set up Depot CLI
50+
uses: depot/setup-action@v1
51+
- name: Log in to GHCR
52+
uses: docker/login-action@v4
53+
with:
54+
registry: ghcr.io
55+
username: ${{ github.actor }}
56+
password: ${{ secrets.GITHUB_TOKEN }}
57+
- name: Derive image metadata
58+
id: meta
59+
uses: docker/metadata-action@v6
60+
with:
61+
images: ${{ env.IMAGE_NAME }}
62+
tags: |
63+
type=semver,pattern={{version}}
64+
type=semver,pattern={{major}}.{{minor}}
65+
type=semver,pattern={{major}}
66+
type=sha
67+
- name: Build and publish image
68+
id: build
69+
uses: depot/build-push-action@v1
70+
with:
71+
project: np622krb2x
72+
context: .
73+
file: ./Dockerfile
74+
platforms: ${{ env.PUBLISH_PLATFORMS }}
75+
push: true
76+
tags: ${{ steps.meta.outputs.tags }}
77+
labels: ${{ steps.meta.outputs.labels }}
78+
- name: Generate image digest attestation
79+
uses: actions/attest@v4
80+
with:
81+
subject-name: ${{ env.IMAGE_NAME }}
82+
subject-digest: ${{ steps.build.outputs.digest }}
83+
push-to-registry: true
84+
- name: Record published digest
85+
run: |
86+
{
87+
echo "Published image: ${{ env.IMAGE_NAME }}"
88+
echo "Published platforms: ${{ env.PUBLISH_PLATFORMS }}"
89+
echo "Published digest: ${{ steps.build.outputs.digest }}"
90+
echo "Published attestation: ${{ env.IMAGE_NAME }}@${{ steps.build.outputs.digest }}"
91+
} >> "$GITHUB_STEP_SUMMARY"

.github/workflows/build.yaml

Lines changed: 82 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,101 @@
11
name: build
22

33
on:
4-
pull_request:
5-
push:
6-
branches:
7-
- main
8-
tags:
9-
- "v*"
10-
workflow_dispatch:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
tags:
9+
- "v*"
10+
workflow_dispatch:
1111

1212
permissions:
13-
artifact-metadata: write
14-
attestations: write
15-
contents: read
16-
packages: write
17-
id-token: write
13+
artifact-metadata: write
14+
attestations: write
15+
contents: read
16+
packages: write
17+
id-token: write
1818

1919
env:
20-
IMAGE_NAME: ghcr.io/getarcaneapp/tools
21-
PUBLISH_PLATFORMS: linux/amd64,linux/386,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
20+
IMAGE_NAME: ghcr.io/getarcaneapp/tools
21+
PUBLISH_PLATFORMS: linux/amd64,linux/386,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
2222

2323
jobs:
24-
validate:
25-
runs-on: ubuntu-latest
26-
steps:
27-
- name: Check out repository
28-
uses: actions/checkout@v6
24+
validate:
25+
if: ${{ github.repository_owner != 'getarcaneapp' && github.actor !=
26+
'getarcaneappbot' }}
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Check out repository
30+
uses: actions/checkout@v6
2931

30-
- name: Set up Docker Buildx
31-
uses: docker/setup-buildx-action@v4
32+
- name: Set up Docker Buildx
33+
uses: docker/setup-buildx-action@v4
3234

33-
- name: Build validation image
34-
uses: docker/build-push-action@v7
35-
with:
36-
context: .
37-
load: true
38-
platforms: linux/amd64
39-
tags: arcane-toolbox:ci
35+
- name: Build validation image
36+
uses: docker/build-push-action@v7
37+
with:
38+
context: .
39+
load: true
40+
platforms: linux/amd64
41+
tags: arcane-toolbox:ci
4042

41-
- name: Validate runtime contract
42-
run: ./scripts/validate.sh arcane-toolbox:ci
43+
- name: Validate runtime contract
44+
run: ./scripts/validate.sh arcane-toolbox:ci
4345

44-
publish:
45-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
46-
needs: validate
47-
runs-on: depot-ubuntu-latest
48-
steps:
49-
- name: Check out repository
50-
uses: actions/checkout@v6
46+
publish:
47+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
48+
needs: validate
49+
runs-on: depot-ubuntu-latest
50+
steps:
51+
- name: Check out repository
52+
uses: actions/checkout@v6
5153

52-
- name: Set up Depot CLI
53-
uses: depot/setup-action@v1
54+
- name: Set up Depot CLI
55+
uses: depot/setup-action@v1
5456

55-
- name: Log in to GHCR
56-
uses: docker/login-action@v4
57-
with:
58-
registry: ghcr.io
59-
username: ${{ github.actor }}
60-
password: ${{ secrets.GITHUB_TOKEN }}
57+
- name: Log in to GHCR
58+
uses: docker/login-action@v4
59+
with:
60+
registry: ghcr.io
61+
username: ${{ github.actor }}
62+
password: ${{ secrets.GITHUB_TOKEN }}
6163

62-
- name: Derive image metadata
63-
id: meta
64-
uses: docker/metadata-action@v6
65-
with:
66-
images: ${{ env.IMAGE_NAME }}
67-
tags: |
68-
type=semver,pattern={{version}}
69-
type=semver,pattern={{major}}.{{minor}}
70-
type=semver,pattern={{major}}
71-
type=sha
64+
- name: Derive image metadata
65+
id: meta
66+
uses: docker/metadata-action@v6
67+
with:
68+
images: ${{ env.IMAGE_NAME }}
69+
tags: |
70+
type=semver,pattern={{version}}
71+
type=semver,pattern={{major}}.{{minor}}
72+
type=semver,pattern={{major}}
73+
type=sha
7274
73-
- name: Build and publish image
74-
id: build
75-
uses: depot/build-push-action@v1
76-
with:
77-
project: np622krb2x
78-
context: .
79-
file: ./Dockerfile
80-
platforms: ${{ env.PUBLISH_PLATFORMS }}
81-
push: true
82-
tags: ${{ steps.meta.outputs.tags }}
83-
labels: ${{ steps.meta.outputs.labels }}
75+
- name: Build and publish image
76+
id: build
77+
uses: depot/build-push-action@v1
78+
with:
79+
project: np622krb2x
80+
context: .
81+
file: ./Dockerfile
82+
platforms: ${{ env.PUBLISH_PLATFORMS }}
83+
push: true
84+
tags: ${{ steps.meta.outputs.tags }}
85+
labels: ${{ steps.meta.outputs.labels }}
8486

85-
- name: Generate image digest attestation
86-
uses: actions/attest@v4
87-
with:
88-
subject-name: ${{ env.IMAGE_NAME }}
89-
subject-digest: ${{ steps.build.outputs.digest }}
90-
push-to-registry: true
87+
- name: Generate image digest attestation
88+
uses: actions/attest@v4
89+
with:
90+
subject-name: ${{ env.IMAGE_NAME }}
91+
subject-digest: ${{ steps.build.outputs.digest }}
92+
push-to-registry: true
9193

92-
- name: Record published digest
93-
run: |
94-
{
95-
echo "Published image: ${{ env.IMAGE_NAME }}"
96-
echo "Published platforms: ${{ env.PUBLISH_PLATFORMS }}"
97-
echo "Published digest: ${{ steps.build.outputs.digest }}"
98-
echo "Published attestation: ${{ env.IMAGE_NAME }}@${{ steps.build.outputs.digest }}"
99-
} >> "$GITHUB_STEP_SUMMARY"
94+
- name: Record published digest
95+
run: |
96+
{
97+
echo "Published image: ${{ env.IMAGE_NAME }}"
98+
echo "Published platforms: ${{ env.PUBLISH_PLATFORMS }}"
99+
echo "Published digest: ${{ steps.build.outputs.digest }}"
100+
echo "Published attestation: ${{ env.IMAGE_NAME }}@${{ steps.build.outputs.digest }}"
101+
} >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)