Skip to content

Commit a000c5d

Browse files
committed
Standardize docker workflows
1 parent c02ba15 commit a000c5d

3 files changed

Lines changed: 23 additions & 46 deletions

File tree

.github/workflows/docker.build.pr.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
1-
name: Docker build & push
1+
name: Docker build
22

33
on:
44
push:
5-
branches: main
5+
branches:
6+
- 'main'
7+
tags:
8+
- '*'
9+
pull_request:
610

711
jobs:
8-
docker-build-and-push:
12+
docker-build:
913
runs-on: ubuntu-latest
1014
steps:
1115
-
1216
name: Checkout
1317
uses: actions/checkout@v2
18+
-
19+
name: Docker meta
20+
id: docker_meta
21+
uses: crazy-max/ghaction-docker-meta@v1
22+
with:
23+
images: ghcr.io/${{ github.repository }}
1424
-
1525
name: Set up QEMU
1626
uses: docker/setup-qemu-action@v1
@@ -41,6 +51,6 @@ jobs:
4151
platforms: linux/amd64
4252
cache-from: type=local,src=/tmp/.buildx-cache
4353
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache
44-
push: true
45-
tags: |
46-
ghcr.io/wbstack/queryservice-gateway:latest
54+
push: ${{ github.event_name != 'pull_request' }}
55+
tags: ${{ steps.docker_meta.outputs.tags }}
56+
labels: ${{ steps.docker_meta.outputs.labels }}

.github/workflows/docker.lint.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: Docker lint
2-
on: [push]
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
pull_request:
8+
39
jobs:
410
lint:
511
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)