Skip to content

Commit ac72ea0

Browse files
committed
feat: trigger on release create
1 parent 0abc9e1 commit ac72ea0

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

.github/workflows/delete-old-image.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ jobs:
77

88
cleanup-pg:
99
runs-on: ubuntu-latest
10+
1011
steps:
1112

1213
- name: Cleanup Docker images from GHCR
1314
uses: dataaxiom/ghcr-cleanup-action@v1
1415
with:
15-
token: ${{ secrets.GITHUB_TOKEN }}
16-
owner: ${{ github.repository_owner }}
17-
repository: multi-repo/Postgres
16+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
17+
owner: multi-repo
18+
repository: postgres
1819
keep-n-tagged: 1
19-
package: multi-repo/Postgres/pg
20+
package: postgres/pg
2021
dry-run: false

.github/workflows/docker-builds.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
name: Build Docker Images
22

33
on:
4-
push:
5-
branches:
6-
- main
74
release:
8-
types: [created, published, released]
9-
10-
5+
types: [published]
6+
push:
7+
branches:
8+
- main
9+
1110
jobs:
1211

1312
ghcr-build-pg:
@@ -55,15 +54,15 @@ jobs:
5554

5655
delete-old-images:
5756
runs-on: ubuntu-latest
58-
5957
steps:
60-
- name: Trigger Delete Old Image Workflow
58+
- name: Trigger delete-old-image workflow
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
6161
run: |
62-
curl -X POST \
63-
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
64-
-H "Accept: application/vnd.github.v3+json" \
65-
https://api.github.com/repos/${{ github.repository }}/actions/workflows/delete-old-image.yml/dispatches \
66-
-d '{"ref": "main"}'
62+
curl -X POST -H "Authorization: Bearer $GITHUB_TOKEN" \
63+
-H "Accept: application/vnd.github.v3+json" \
64+
https://api.github.com/repos/multi-repo/postgres/actions/workflows/delete-old-image.yml/dispatches \
65+
-d '{"ref":"main"}'
6766
6867
6968
deploy:

0 commit comments

Comments
 (0)