Skip to content

Commit a2f063e

Browse files
committed
move docker image creation to its own action
1 parent 25fb6ff commit a2f063e

File tree

2 files changed

+44
-38
lines changed

2 files changed

+44
-38
lines changed

.github/workflows/bevy_mod_scripting.yml

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -26,44 +26,9 @@ concurrency:
2626
cancel-in-progress: true
2727

2828
jobs:
29-
build-runner-image:
30-
permissions:
31-
contents: read
32-
packages: write
33-
runs-on: ubuntu-latest
34-
name: Build multi-platform Docker image
35-
outputs:
36-
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags }}
37-
steps:
38-
- uses: actions/checkout@v4
39-
- uses: docker/setup-qemu-action@v3
40-
- uses: docker/setup-buildx-action@v3
41-
- name: Docker meta
42-
id: meta
43-
uses: docker/metadata-action@v5
44-
with:
45-
images: |
46-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
47-
- name: Login to GitHub Container Registry
48-
uses: docker/login-action@v3
49-
with:
50-
registry: ghcr.io
51-
username: ${{ github.actor }}
52-
password: ${{ secrets.GITHUB_TOKEN }}
53-
- uses: docker/build-push-action@v5
54-
with:
55-
context: .
56-
file: ./crates/xtask/Dockerfile
57-
platforms: linux/amd64,linux/arm64
58-
cache-from: type=gha
59-
cache-to: type=gha,mode=max
60-
tags: ${{ steps.meta.outputs.tags }}
61-
labels: ${{ steps.meta.outputs.labels }}
62-
6329
generate-job-matrix:
64-
needs: build-runner-image
6530
runs-on: ubuntu-latest
66-
container: ${{ needs.build-runner-image.outputs.image }}
31+
# container: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
6732
outputs:
6833
matrix: ${{ steps.generate-matrix.outputs.matrix }}
6934
steps:
@@ -83,10 +48,9 @@ jobs:
8348
pull-requests: write
8449
name: Check - ${{ matrix.run_args.name }}
8550
runs-on: ${{ matrix.run_args.os }}
86-
container: ${{ needs.build-runner-image.outputs.image }}
51+
# container: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
8752
needs:
8853
- generate-job-matrix
89-
- build-runner-image
9054
strategy:
9155
matrix:
9256
run_args: ${{fromJson(needs.generate-job-matrix.outputs.matrix)}}

.github/workflows/build-ci-image.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
on:
2+
workflow_dispatch:
3+
4+
5+
env:
6+
REGISTRY: ghcr.io
7+
IMAGE_NAME: bevy-mod-scripting
8+
9+
jobs:
10+
build-runner-image:
11+
permissions:
12+
contents: read
13+
packages: write
14+
runs-on: ubuntu-latest
15+
name: Build multi-platform Docker image
16+
outputs:
17+
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: docker/setup-qemu-action@v3
21+
- uses: docker/setup-buildx-action@v3
22+
- name: Docker meta
23+
id: meta
24+
uses: docker/metadata-action@v5
25+
with:
26+
images: |
27+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
28+
- name: Login to GitHub Container Registry
29+
uses: docker/login-action@v3
30+
with:
31+
registry: ghcr.io
32+
username: ${{ github.actor }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
34+
- uses: docker/build-push-action@v5
35+
with:
36+
context: .
37+
file: ./crates/xtask/Dockerfile
38+
platforms: linux/amd64,linux/arm64
39+
cache-from: type=gha
40+
cache-to: type=gha,mode=max
41+
tags: ${{ steps.meta.outputs.tags }}
42+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)