Skip to content

Commit 73b7ba9

Browse files
authored
Replace Dockerhub with GHCR for extension repo (#5213)
1 parent fd6ac8d commit 73b7ba9

7 files changed

+55
-52
lines changed

.github/workflows/build-and-deploy-extension.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ jobs:
2121
build-extensions:
2222
uses: ./.github/workflows/build-extensions.yml
2323

24-
get-dockerhub-extensions:
25-
uses: ./.github/workflows/get-extensions-from-dockerhub.yml
24+
get-ghcr-extensions:
25+
uses: ./.github/workflows/get-extensions-from-ghcr.yml
2626

2727
package-built-extensions:
2828
runs-on: ubuntu-22.04
2929
needs:
3030
- build-extensions
31-
- get-dockerhub-extensions
31+
- get-ghcr-extensions
3232
steps:
3333
- name: Free disk space on Ubuntu runner
3434
uses: kfir4444/free-disk-space@main
@@ -58,7 +58,7 @@ jobs:
5858

5959
- uses: actions/download-artifact@v4
6060
with:
61-
name: dockerhub-extensions
61+
name: ghcr-extensions
6262

6363
- name: Clear old artifacts
6464
run: rm -rf releases/$RELEASE_VERSION/

.github/workflows/deploy-extension.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
jobs:
77
deploy-extensions:
88
runs-on: ubuntu-22.04
9+
permissions:
10+
packages: write
911
steps:
1012
- name: Free disk space on Ubuntu runner
1113
uses: kfir4444/free-disk-space@main
@@ -32,15 +34,16 @@ jobs:
3234
- name: Set up Docker Buildx
3335
uses: docker/setup-buildx-action@v3
3436

35-
- name: Login to Docker Hub
37+
- name: Login to ghcr.io
3638
uses: docker/login-action@v3
3739
with:
38-
username: ${{ secrets.DOCKERHUB_USERNAME }}
39-
password: ${{ secrets.DOCKERHUB_TOKEN }}
40+
registry: ghcr.io
41+
username: ${{ github.actor }}
42+
password: ${{ secrets.GITHUB_TOKEN }}
4043

4144
- name: Build and push
4245
uses: docker/build-push-action@v5
4346
with:
4447
context: .
4548
push: true
46-
tags: kuzudb/extension-repo:latest
49+
tags: ghcr.io/kuzudb/extension-repo:latest

.github/workflows/get-extensions-from-dockerhub.yml

-38
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Get Extensions from GHCR
2+
on:
3+
workflow_dispatch:
4+
workflow_call:
5+
6+
jobs:
7+
get-ghcr-extensions:
8+
runs-on: ubuntu-22.04
9+
steps:
10+
- name: Free disk space on Ubuntu runner
11+
uses: kfir4444/free-disk-space@main
12+
with:
13+
tool-cache: true
14+
android: true
15+
dotnet: true
16+
haskell: true
17+
large-packages: true
18+
swap-storage: true
19+
20+
- name: Pull ghcr extensions and run container
21+
run: |
22+
docker pull ghcr.io/kuzudb/extension-repo:latest
23+
docker run --rm -d --name kuzu-extensions ghcr.io/kuzudb/extension-repo:latest tail -f /dev/null
24+
25+
- name: Copy ghcr extensions
26+
run: |
27+
mkdir ./ghcr-extensions
28+
docker cp kuzu-extensions:/usr/share/nginx/html ./ghcr-extensions
29+
sudo chown -R $USER:$USER ghcr-extensions
30+
sudo chmod -R 755 ghcr-extensions
31+
mv ghcr-extensions/html/dataset ghcr-extensions/dataset
32+
mv ghcr-extensions/html/ ghcr-extensions/releases
33+
34+
- name: Upload ghcr extensions
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: ghcr-extensions
38+
path: ghcr-extensions

.github/workflows/purge-extension.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
get-dockerhub-extensions:
8-
uses: ./.github/workflows/get-extensions-from-dockerhub.yml
7+
get-ghcr-extensions:
8+
uses: ./.github/workflows/get-extensions-from-ghcr.yml
99

1010
purge-extensions:
11-
needs: get-dockerhub-extensions
11+
needs: get-ghcr-extensions
1212
runs-on: ubuntu-22.04
1313
steps:
1414
- name: Free disk space on Ubuntu runner
@@ -31,7 +31,7 @@ jobs:
3131
3232
- uses: actions/download-artifact@v4
3333
with:
34-
name: dockerhub-extensions
34+
name: ghcr-extensions
3535

3636
- name: Purge extensions
3737
run: python3 purge-beta.py

scripts/extension/compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3'
22
services:
33
file-server:
4-
image: kuzudb/extension-repo
4+
image: ghcr.io/kuzudb/extension-repo
55
pull_policy: always
66
ports:
77
- "8081:80"

scripts/extension/purge-beta.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
if len(releases_to_purge) == 0:
2222
print('No releases to purge.')
23-
exit(1)
23+
exit(0)
2424

2525
print('Releases to purge:')
2626
for r in releases_to_purge:

0 commit comments

Comments
 (0)