Skip to content

Commit dd8d43b

Browse files
committed
refactor: update workflow to publish to ghcr.io and use cache
1 parent 552e998 commit dd8d43b

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎.github/workflows/docker-publish.yml‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
jobs:
1010
build-and-push:
1111
runs-on: ubuntu-latest
12+
permissions:
13+
packages: write
14+
contents: read
1215

1316
steps:
1417
- name: Checkout repository
@@ -20,10 +23,21 @@ jobs:
2023
- name: Set up Docker Buildx
2124
uses: docker/setup-buildx-action@v4
2225

26+
- name: Log in to GitHub Container Registry
27+
uses: docker/login-action@v4
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
2333
- name: Build and push image
2434
uses: docker/build-push-action@v7
2535
with:
2636
context: .
2737
file: Dockerfile
2838
push: true
29-
tags: ttl.sh/loggerbot:24h
39+
tags: |
40+
ghcr.io/${{ github.repository }}:latest
41+
ghcr.io/${{ github.repository }}:sha-${{ github.sha }}
42+
cache-from: type=gha
43+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)