Skip to content

Commit ed09e0f

Browse files
ci: add build and push image workflow
1 parent 62ce03a commit ed09e0f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: CI
2+
on: [push]
3+
4+
jobs:
5+
build-and-push-image:
6+
runs-on: ubuntu-latest
7+
env:
8+
IMAGE_NAME: "oc4ids-datastore-api"
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Login to GitHub Container Registry
12+
uses: docker/login-action@v3
13+
with:
14+
registry: ghcr.io
15+
username: ${{ github.actor }}
16+
password: ${{ secrets.GITHUB_TOKEN }}
17+
- name: Build and push image
18+
run: |
19+
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
20+
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
21+
echo $IMAGE_ID
22+
docker build . -t ${IMAGE_ID}
23+
docker push ${IMAGE_ID}:latest

0 commit comments

Comments
 (0)