Skip to content

Commit f0cba5d

Browse files
committed
test pipeline
1 parent 93882c2 commit f0cba5d

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

.github/workflows/main.yml .github/workflows/build.yml

+2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ on:
88
- 'internal/**'
99
- 'go.mod'
1010
- 'go.sum'
11+
workflow_call:
1112

1213
jobs:
1314
build:
15+
name: Build and Test
1416
runs-on: ubuntu-latest
1517
strategy:
1618
matrix:

.github/workflows/release.yml .github/workflows/deploy.yml

+19-18
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
name: Release
1+
name: Deploy
22

33
on:
4-
workflow_run:
5-
workflows:
6-
- "Build & Test"
7-
types:
8-
- completed
94
push:
105
tags:
116
- 'v*.*.*'
@@ -14,7 +9,12 @@ env:
149
DOCKERHUB_REPO: caik/go-mock-server
1510

1611
jobs:
17-
release:
12+
build:
13+
uses: ./.github/workflows/build.yml
14+
15+
github-release:
16+
name: Create Github Release
17+
needs: build
1818
runs-on: ubuntu-latest
1919
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
2020
steps:
@@ -40,8 +40,8 @@ jobs:
4040
GH_RELEASER: ${{ secrets.GH_RELEASER }}
4141

4242
docker-build:
43-
needs: release
44-
name: Deploy to DockerHub
43+
name: Build Docker Image
44+
needs: build
4545
runs-on: ubuntu-latest
4646
strategy:
4747
fail-fast: false
@@ -57,7 +57,7 @@ jobs:
5757
platform=${{ matrix.platform }}
5858
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
5959
60-
- name: Docker meta
60+
- name: Docker Meta
6161
id: meta
6262
uses: docker/metadata-action@v5
6363
with:
@@ -76,7 +76,7 @@ jobs:
7676
with:
7777
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
7878

79-
- name: Build and push by digest
79+
- name: Build and Push by Digest
8080
id: build
8181
uses: docker/build-push-action@v6
8282
with:
@@ -85,26 +85,27 @@ jobs:
8585
outputs: type=image,"name=${{ env.DOCKERHUB_REPO }}",push-by-digest=true,name-canonical=true,push=true
8686
build-args: VERSION=${GITHUB_REF#refs/*/}
8787

88-
- name: Export digest
88+
- name: Export Digest
8989
run: |
9090
mkdir -p /tmp/digests
9191
digest="${{ steps.build.outputs.digest }}"
9292
touch "/tmp/digests/${digest#sha256:}"
9393
94-
- name: Upload digest
94+
- name: Upload Digest
9595
uses: actions/upload-artifact@v4
9696
with:
9797
name: digests-${{ env.PLATFORM_PAIR }}
9898
path: /tmp/digests/*
9999
if-no-files-found: error
100100
retention-days: 1
101101

102-
merge:
102+
docker-merge:
103+
name: Merge Docker Multi-Arch Images
103104
runs-on: ubuntu-latest
104105
needs:
105106
- docker-build
106107
steps:
107-
- name: Download digests
108+
- name: Download Digests
108109
uses: actions/download-artifact@v4
109110
with:
110111
path: /tmp/digests
@@ -120,7 +121,7 @@ jobs:
120121
- name: Set up Docker Buildx
121122
uses: docker/setup-buildx-action@v3
122123

123-
- name: Docker meta
124+
- name: Docker Meta
124125
id: meta
125126
uses: docker/metadata-action@v5
126127
with:
@@ -131,12 +132,12 @@ jobs:
131132
type=semver,pattern={{version}}
132133
type=semver,pattern={{major}}.{{minor}}
133134
134-
- name: Create manifest list and push
135+
- name: Create Manifest List and Push
135136
working-directory: /tmp/digests
136137
run: |
137138
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
138139
$(printf '${{ env.DOCKERHUB_REPO }}@sha256:%s ' *)
139140
140-
- name: Inspect image
141+
- name: Inspect Image
141142
run: |
142143
docker buildx imagetools inspect ${{ env.DOCKERHUB_REPO }}:${{ steps.meta.outputs.version }}

0 commit comments

Comments
 (0)