-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.42 KB
/
cd.docker.yml
File metadata and controls
59 lines (50 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: cd·docker
run-name: cd·docker
on:
push:
branches:
- main
paths:
- .github/workflows/cd.docker.yml
- .github/Dockerfile
- brewkit/**/*.ts
workflow_dispatch:
concurrency:
group: docker
cancel-in-progress: true
permissions:
contents: read
packages: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: docker/auth
run: echo "${{ github.token }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/bldbot
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
# TODO --platform linux/amd64,linux/arm64
- name: docker/buildx
run: |
docker buildx build \
--push \
--tag ghcr.io/${{ github.repository_owner }}/bldbot:latest \
--platform linux/amd64 \
--file .github/Dockerfile \
.
prune:
needs: deploy
runs-on: ubuntu-latest
steps:
- uses: actions/delete-package-versions@v5
with:
package-name: bldbot
package-type: container
min-versions-to-keep: 10
# ^^ despite telling it to only delete untagged versions
# it deletes images attached to latest like a lolfactory
delete-only-untagged-versions: true