Skip to content

Commit 1a40bb8

Browse files
authored
Update cicd.yml
Revert to old cicd
1 parent 0d4db23 commit 1a40bb8

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/cicd.yml

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
name: CICD
22

33
on:
4+
push:
5+
branches: ["**"]
6+
tags: ["*.*.*"]
47
release:
5-
types: [published, prereleased]
8+
types: [created]
69

710
env:
811
REGISTRY: ghcr.io
@@ -25,6 +28,7 @@ jobs:
2528
- name: Checkout repository
2629
uses: actions/checkout@v4
2730

31+
# replaces slashes with dashes in platform name
2832
- name: Convert platform pairs
2933
run: |
3034
platform=${{ matrix.platform }}
@@ -34,6 +38,7 @@ jobs:
3438
uses: docker/setup-buildx-action@v3
3539

3640
- name: Log into registry ${{ env.REGISTRY }}
41+
if: github.event_name != 'pull_request'
3742
uses: docker/login-action@v3
3843
with:
3944
registry: ${{ env.REGISTRY }}
@@ -53,7 +58,7 @@ jobs:
5358
context: .
5459
platforms: ${{ matrix.platform }}
5560
labels: ${{ steps.meta.outputs.labels }}
56-
outputs: type=image,name=${{ env.REGISTRY }}/${{ github.repository }},push-by-digest=true,name-canonical=true,push=true
61+
outputs: type=image,name=${{ env.REGISTRY }}/${{ github.repository }},push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }}
5762

5863
- name: Export digest
5964
run: |
@@ -71,6 +76,7 @@ jobs:
7176

7277
merge:
7378
runs-on: ubuntu-latest
79+
if: ${{ github.event_name != 'pull_request' }}
7480
needs:
7581
- build
7682
steps:
@@ -90,10 +96,14 @@ jobs:
9096
with:
9197
images: ${{ env.REGISTRY }}/${{ github.repository }}
9298
tags: |
99+
type=ref,event=branch
93100
type=ref,event=tag
101+
type=ref,event=pr
102+
type=sha
94103
type=semver,pattern={{version}}
95104
96105
- name: Log into registry ${{ env.REGISTRY }}
106+
if: github.event_name != 'pull_request'
97107
uses: docker/login-action@v3
98108
with:
99109
registry: ${{ env.REGISTRY }}
@@ -108,4 +118,4 @@ jobs:
108118
109119
- name: Inspect image
110120
run: |
111-
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ github.repository }}:${{ steps.meta.outputs.version }}
121+
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ github.repository }}:${{ steps.meta.outputs.version }}

0 commit comments

Comments
 (0)