Skip to content

Commit 4b8bc8b

Browse files
committed
Add github workflow to build docker image and push to registry
1 parent ed23152 commit 4b8bc8b

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Builde docker image
2+
3+
on:
4+
push:
5+
branches: ['**']
6+
pull_request:
7+
branches: ['**']
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
with:
18+
submodules: true
19+
20+
- run: echo "IMAGE_TAG=${GITHUB_REF_NAME//\//-}" >> $GITHUB_ENV
21+
22+
- name: Build docker image
23+
run: docker build -t p2pu/lernanta:${IMAGE_TAG} .
24+
25+
- name: log into registry
26+
uses: docker/login-action@v2
27+
with:
28+
registry: ${{ env.REGISTRY }}
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: push docker image
33+
run: |
34+
docker tag p2pu/lernanta:${IMAGE_TAG} ghcr.io/p2pu/lernanta:${IMAGE_TAG}
35+
docker push ghcr.io/p2pu/lernanta:${IMAGE_TAG}

0 commit comments

Comments
 (0)