Skip to content

Commit 6ce749e

Browse files
committed
add build action to generate container images
1 parent fb17f3e commit 6ce749e

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/publish.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
branches:
11+
- "master"
12+
13+
jobs:
14+
docker:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v2
19+
20+
- name: Docker meta
21+
id: meta
22+
uses: docker/metadata-action@v4
23+
with:
24+
# list of Docker images to use as base name for tags
25+
images: |
26+
ghcr.io/igor47/smrs
27+
flavor: |
28+
latest=auto
29+
30+
- name: Login to GitHub Container Registry
31+
uses: docker/login-action@v2
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Build and Push Docker Image
38+
uses: docker/build-push-action@v3
39+
with:
40+
push: ${{ github.event_name != 'pull_request' }}
41+
tags: ${{ steps.meta.outputs.tags }}
42+
cache-from: type=gha
43+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)