-
Notifications
You must be signed in to change notification settings - Fork 4
46 lines (40 loc) · 1.3 KB
/
build_container_image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Publish Docker image
# on:
# release:
# types: [published]
on:
push:
branches:
- main
workflow_dispatch:
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# with:
# submodules: true
- name: submodule checkout
run: |
sed -i 's/[email protected]:/https:\/\/github.com\//g' .gitmodules
sed -i 's/[email protected]:/https:\/\/gitlab.com\//g' .gitmodules
git submodule sync --recursive || true
git submodule update --init --recursive || true
# git submodule update --init
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: 'Build and push Image'
run: |
./docker-build-and-run.sh "--build-only"
docker save maxhbr/ldbcollector:latest | gzip > ldbcollector_latest.tar.gz
docker tag "maxhbr/ldbcollector" "ghcr.io/maxhbr/ldbcollector:latest"
docker push "ghcr.io/maxhbr/ldbcollector:latest"
- uses: actions/upload-artifact@v2
with:
name: dockerimage
path: ldbcollector_latest.tar.gz