Skip to content

Commit 996489d

Browse files
committed
add github actions
1 parent 653b94b commit 996489d

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/publish.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Create and publish a Docker image
2+
3+
on:
4+
push:
5+
branches: ['master']
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
10+
11+
jobs:
12+
build-and-push-image:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v3
20+
- name: Log in to the Container registry
21+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
22+
with:
23+
registry: ${{ env.REGISTRY }}
24+
username: ${{ github.actor }}
25+
password: ${{ secrets.GITHUB_TOKEN }}
26+
- name: Extract metadata (tags, labels) for Docker
27+
id: meta
28+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
29+
with:
30+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
31+
- name: Build and push Docker image
32+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
33+
with:
34+
context: .
35+
push: true
36+
tags: ${{ steps.meta.outputs.tags }}
37+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)