Skip to content

Commit 6e28213

Browse files
ebrains ci jobs
1 parent b9beeef commit 6e28213

2 files changed

Lines changed: 116 additions & 0 deletions

File tree

.github/workflows/ebrains.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Mirror to Ebrains
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- master
8+
workflow_dispatch:
9+
10+
jobs:
11+
to_ebrains:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: syncmaster
15+
uses: wei/git-sync@v3
16+
with:
17+
source_repo: "Medical-Informatics-Platform/platform-ui"
18+
source_branch: "master"
19+
destination_repo: "https://ghpusher:${{ secrets.EBRAINS_GITLAB_ACCESS_TOKEN }}@gitlab.ebrains.eu/hbp-mip/platform-ui.git"
20+
destination_branch: "master"
21+
- name: synctags
22+
uses: wei/git-sync@v3
23+
with:
24+
source_repo: "Medical-Informatics-Platform/platform-ui"
25+
source_branch: "refs/tags/*"
26+
destination_repo: "https://ghpusher:${{ secrets.EBRAINS_GITLAB_ACCESS_TOKEN }}@gitlab.ebrains.eu/hbp-mip/platform-ui.git"
27+
destination_branch: "refs/tags/*"
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Publish images
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- master
8+
workflow_dispatch:
9+
10+
env:
11+
HARBOR_REGISTRY: docker-registry.ebrains.eu
12+
DOCKER_BUILDKIT: 1
13+
DOCKER_CLIENT_TIMEOUT: 300
14+
COMPOSE_HTTP_TIMEOUT: 300
15+
RETRY_ATTEMPTS: "4"
16+
RETRY_SLEEP: "10"
17+
18+
jobs:
19+
build_and_push_ui:
20+
name: Build PLATFORM-UI image and push to registries
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Check out repository
25+
uses: actions/checkout@v6
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
30+
- name: Harbor connectivity probe
31+
run: |
32+
set -x
33+
getent hosts ${{ env.HARBOR_REGISTRY }} || true
34+
curl -vI --connect-timeout 10 https://${{ env.HARBOR_REGISTRY }}/v2/ || true
35+
36+
- name: Disable IPv6 (job-scoped)
37+
run: |
38+
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
39+
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
40+
41+
- name: Log in to Docker Hub
42+
uses: docker/login-action@v3
43+
with:
44+
username: ${{ secrets.DOCKER_USERNAME }}
45+
password: ${{ secrets.DOCKER_PASSWORD }}
46+
47+
- name: Log in to EBRAINS HARBOR (retry)
48+
run: |
49+
for i in $(seq 1 ${{ env.RETRY_ATTEMPTS }}); do
50+
echo "${{ secrets.HARBOR_PASSWORD }}" | \
51+
docker login ${{ env.HARBOR_REGISTRY }} \
52+
-u "${{ secrets.HARBOR_USERNAME }}" --password-stdin && exit 0
53+
echo "Harbor login attempt $i failed; retrying in ${{ env.RETRY_SLEEP }}s..."
54+
sleep ${{ env.RETRY_SLEEP }}
55+
done
56+
echo "Harbor login failed after ${{ env.RETRY_ATTEMPTS }} attempts" >&2
57+
exit 1
58+
59+
- name: Extract metadata (tags, labels) for Docker
60+
id: meta
61+
uses: docker/metadata-action@v5
62+
with:
63+
images: |
64+
hbpmip/platform-ui
65+
${{ env.HARBOR_REGISTRY }}/medical-informatics-platform/platform-ui
66+
67+
- name: Load PLATFORM-UI service cached image
68+
uses: actions/cache@v5
69+
with:
70+
path: /tmp/.buildx-cache/platform-ui
71+
key: ${{ runner.os }}-buildx-platform-ui-${{ hashFiles('Dockerfile', 'nginx.conf.template', 'package.json', 'package-lock.json', 'angular.json', 'src/**', 'public/**') }}
72+
restore-keys: |
73+
${{ runner.os }}-buildx-platform-ui-
74+
75+
- name: Build PLATFORM-UI docker image
76+
uses: docker/build-push-action@v6
77+
with:
78+
context: .
79+
file: ./Dockerfile
80+
push: true
81+
tags: ${{ steps.meta.outputs.tags }}
82+
labels: ${{ steps.meta.outputs.labels }}
83+
cache-from: type=local,src=/tmp/.buildx-cache/platform-ui
84+
cache-to: type=local,dest=/tmp/.buildx-cache-new/platform-ui
85+
86+
- name: Move Docker images cache
87+
run: |
88+
rm -rf /tmp/.buildx-cache
89+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

0 commit comments

Comments
 (0)