Skip to content

Commit 4670947

Browse files
committed
Create docker-image.yml
1 parent 0385cfc commit 4670947

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/docker-image.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Configures this workflow to run every time a change is pushed to the branch called `release`.
2+
on:
3+
push:
4+
branches:
5+
- main
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+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Log in to the Container registry
23+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
24+
with:
25+
registry: ${{ env.REGISTRY }}
26+
username: ${{ github.actor }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
29+
# Process for the `director` subfolder
30+
- name: Extract metadata (tags, labels) for Docker (director)
31+
id: metaDirector
32+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
33+
with:
34+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35+
tags: |
36+
# set latest tag for default branch
37+
type=raw,value=latest,enable={{is_default_branch}}
38+
39+
- name: Build and push Docker image syncS3
40+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
41+
with:
42+
context: .
43+
push: true
44+
tags: ${{ steps.metaDirector.outputs.tags }}
45+
labels: ${{ steps.metaDirector.outputs.labels }}
46+
platforms: linux/amd64
47+
48+

0 commit comments

Comments
 (0)