- commit
- 609d54f
- parent
- 1ce0105
- author
- Antonio Mika
- date
- 2022-12-12 00:24:31 +0000 UTC
Change build to use composite instead of matrix action
2 files changed,
+66,
-24
+52,
-0
1@@ -0,0 +1,52 @@
2+name: Run a docker build
3+
4+inputs:
5+ app:
6+ description: The pico app to build
7+ required: true
8+ platforms:
9+ description: The docker platforms to build for
10+ required: false
11+ default: |
12+ linux/amd64
13+ linux/arm64
14+ registry:
15+ description: The docker registry to use
16+ required: false
17+ default: ghcr.io
18+
19+runs:
20+ using: composite
21+ steps:
22+ - name: Collect web image metadata
23+ id: webmeta
24+ uses: docker/metadata-action@v4
25+ with:
26+ images: ${{ inputs.REGISTRY }}/${{ github.repository }}/${{ inputs.app }}-web
27+ - name: Collect ssh image metadata
28+ id: sshmeta
29+ uses: docker/metadata-action@v4
30+ with:
31+ images: ${{ inputs.REGISTRY }}/${{ github.repository }}/${{ inputs.app }}-ssh
32+ - name: Build and push web
33+ uses: docker/build-push-action@v3
34+ with:
35+ context: .
36+ push: true
37+ tags: ${{ steps.webmeta.outputs.tags }}
38+ labels: ${{ steps.webmeta.outputs.labels }}
39+ target: release-web
40+ platform: ${{ inputs.platforms }}
41+ build-args: |
42+ APP=${{ inputs.app }}
43+ - name: Build and push ssh
44+ uses: docker/build-push-action@v3
45+ with:
46+ context: .
47+ push: true
48+ tags: ${{ steps.sshmeta.outputs.tags }}
49+ labels: ${{ steps.sshmeta.outputs.labels }}
50+ target: release-ssh
51+ platform: ${{ inputs.platforms }}
52+ build-args: |
53+ APP=${{ inputs.app }}
+14,
-24
1@@ -11,12 +11,6 @@ on:
2 branches:
3 - main
4
5-env:
6- REGISTRY: ghcr.io
7- PLATFORM: |
8- linux/amd64
9- linux/arm64
10-
11 jobs:
12 test:
13 runs-on: ubuntu-22.04
14@@ -40,10 +34,6 @@ jobs:
15 go test -v ./... -cover -race -coverprofile=coverage.out
16 go tool cover -func=coverage.out -o=coverage.out
17 build:
18- strategy:
19- matrix:
20- app: [prose, lists, pastes, imgs]
21- target: [ssh, web]
22 runs-on: ubuntu-22.04
23 needs: test
24 steps:
25@@ -64,22 +54,22 @@ jobs:
26 registry: ${{ env.REGISTRY }}
27 username: ${{ github.actor }}
28 password: ${{ secrets.GITHUB_TOKEN }}
29- - name: Collect image metadata
30- id: meta
31- uses: docker/metadata-action@v4
32+ - name: Run docker build for lists
33+ uses: ./.github/actions/build
34 with:
35- images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.app }}-${{ matrix.target }}
36- - name: Build and push
37- uses: docker/build-push-action@v3
38+ app: lists
39+ - name: Run docker build for prose
40+ uses: ./.github/actions/build
41 with:
42- context: .
43- push: true
44- tags: ${{ steps.meta.outputs.tags }}
45- labels: ${{ steps.meta.outputs.labels }}
46- target: release-${{ matrix.target }}
47- platform: ${{ env.PLATFORM }}
48- build-args: |
49- APP=${{ matrix.app }}
50+ app: prose
51+ - name: Run docker build for pastes
52+ uses: ./.github/actions/build
53+ with:
54+ app: pastes
55+ - name: Run docker build for imgs
56+ uses: ./.github/actions/build
57+ with:
58+ app: imgs
59 build-caddy:
60 runs-on: ubuntu-22.04
61 needs: test