Skip to content

Commit f76c35e

Browse files
authored
Create docker.yml
1 parent 885ea84 commit f76c35e

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/docker.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish Docker
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths-ignore:
7+
- '.*'
8+
- '**.md'
9+
10+
env:
11+
IMAGE_NAME: ${{ github.repository }}
12+
13+
jobs:
14+
publish:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
- name: Extract metadata for Docker
20+
id: meta
21+
uses: docker/metadata-action@v5
22+
with:
23+
images: ghcr.io/${{ env.IMAGE_NAME }}
24+
- name: Login to GitHub Container Registry
25+
uses: docker/login-action@v3
26+
with:
27+
registry: ghcr.io
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
- name: Build and Push Docker image
31+
uses: docker/build-push-action@v6
32+
with:
33+
context: .
34+
file: Dockerfile
35+
push: true
36+
tags: ${{ steps.meta.outputs.tags }}
37+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)