Skip to content

Commit 31503d2

Browse files
committed
refactor(ci): use ghcr
1 parent 9661db0 commit 31503d2

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

.github/workflows/publish.yaml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,29 @@ name: publish
22
on:
33
push:
44
branches:
5-
- master
5+
- main
6+
67
jobs:
78
publish:
8-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
packages: write
13+
contents: read
14+
915
steps:
10-
- uses: docker/[email protected]
11-
- uses: docker/[email protected]
12-
with:
13-
registry: ghcr.io
14-
username: ${{ github.actor }}
15-
password: ${{ github.token }}
16-
- uses: docker/build-push-action@v2
16+
- name: Set up Docker Buildx
17+
uses: docker/setup-buildx-action@v3
18+
19+
- name: Log in to registry
20+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
21+
22+
- name: Build
23+
uses: docker/build-push-action@v6
1724
with:
1825
push: true
19-
tags: ghcr.io/${{ github.repository }},ghcr.io/${{ github.repository }}:sha-${{ github.sha }}
20-
cache-from: type=gha
21-
cache-to: type=gha,mode=max
26+
tags: |
27+
ghcr.io/otter-sec/rctf-admin-bot:${{ github.sha }}
28+
ghcr.io/otter-sec/rctf-admin-bot:${{ github.ref_name }}
29+
cache-from: type=registry,ref=ghcr.io/otter-sec/rctf-admin-bot:main
30+
cache-to: type=inline

0 commit comments

Comments
 (0)