Skip to content

Commit d554ab3

Browse files
authored
Merge pull request #18 from n3-rd/publish-curl
chore: Add GitHub Actions workflow for publishing Docker images to GHCR on main branch push
2 parents e9bbff8 + 8e5db58 commit d554ab3

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/publish.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish to GHCR
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Docker Buildx
19+
uses: docker/setup-buildx-action@v3
20+
21+
- name: Log in to GHCR
22+
uses: docker/login-action@v3
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Extract metadata
29+
id: meta
30+
uses: docker/metadata-action@v5
31+
with:
32+
images: ghcr.io/${{ github.repository }}
33+
34+
- name: Build and push
35+
uses: docker/build-push-action@v5
36+
with:
37+
context: .
38+
push: true
39+
tags: |
40+
ghcr.io/${{ github.repository }}:latest
41+
${{ steps.meta.outputs.tags }}
42+
cache-from: type=gha
43+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)