Skip to content

Commit 4840cc8

Browse files
authored
Create a CI to push to harbor automatically (#124)
* Create push-to-registry.yml * use rcp registry
1 parent ed045a7 commit 4840cc8

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: BuildAndPushImageOnHarbor
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
13+
- name: Add SHORT_SHA env property with commit short sha
14+
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
15+
16+
- uses: docker/login-action@v1
17+
with:
18+
registry: registry.rcp.epfl.ch
19+
username: ${{ secrets.HARBOR_USERNAME }}
20+
password: ${{ secrets.HARBOR_PASSWORD }}
21+
22+
- uses: actions/checkout@v3
23+
- name: BuildAndPushImageOnHarbor
24+
run: |
25+
docker build ./ -t registry.rcp.epfl.ch/swiss-ai-mmore/mmore:${SHORT_SHA}
26+
docker push registry.rcp.epfl.ch/swiss-ai-mmore/mmore:${SHORT_SHA}

0 commit comments

Comments
 (0)