Skip to content

Commit a6c8341

Browse files
committed
wip
1 parent ff8e7d7 commit a6c8341

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/docker-build.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches: [ develop, main, docker ]
6+
pull_request:
7+
branches: [ develop ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v3
20+
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v2
23+
24+
- name: Log in to GitHub Container Registry
25+
uses: docker/login-action@v2
26+
with:
27+
registry: ghcr.io
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Extract metadata for Docker
32+
id: meta
33+
uses: docker/metadata-action@v4
34+
with:
35+
images: ghcr.io/${{ github.repository }}/cws
36+
tags: |
37+
type=ref,event=branch
38+
type=ref,event=pr
39+
type=sha,format=short
40+
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'develop') }}
41+
42+
- name: Build and push Docker image
43+
uses: docker/build-push-action@v4
44+
with:
45+
context: ./install/docker/cws-image
46+
push: ${{ github.event_name != 'pull_request' }}
47+
tags: ${{ steps.meta.outputs.tags }}
48+
labels: ${{ steps.meta.outputs.labels }}
49+
cache-from: type=gha
50+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)