Skip to content

Commit f4fd851

Browse files
committed
Upgrade actions and add package deleter
1 parent 1cc7c72 commit f4fd851

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.github/workflows/build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ jobs:
1717
contents: read
1818
packages: write
1919
steps:
20-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2121

2222
- name: Build the image
2323
run: make build
2424

2525
- name: Log in to ghcr
26-
uses: docker/login-action@v2
26+
uses: docker/login-action@v3
2727
if: github.event_name == 'release'
2828
with:
2929
registry: ghcr.io

.github/workflows/pr-image.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
name: Build and push image from PR
1+
name: PR build and push
22

33
on:
44
pull_request:
55
types: [opened, synchronize, reopened]
66

77
jobs:
88
build:
9-
name: Build and push image from PR
9+
name: Push pre-release image from PR
1010
runs-on: ubuntu-latest
1111
permissions:
1212
contents: read
1313
packages: write
1414

1515
steps:
1616
- name: Checkout code
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818

1919
- name: Log in to ghcr
20-
uses: docker/login-action@v2
20+
uses: docker/login-action@v3
2121
with:
2222
registry: ghcr.io
2323
username: ${{ github.actor }}
@@ -30,3 +30,11 @@ jobs:
3030
run: make pr-image
3131
env:
3232
TAG: ${{ github.head_ref }}
33+
34+
- name: Cleanup older pre-release images
35+
uses: actions/delete-package-versions@v5
36+
with:
37+
package-name: 'coder-dev'
38+
package-type: 'container'
39+
min-versions-to-keep: 10
40+
delete-only-pre-release-versions: "true"

0 commit comments

Comments
 (0)