Skip to content

Commit 2e889fb

Browse files
authored
chore(ci): fixed dockerhub ci process (OpenListTeam#97)
* add DockerHub * fixed dockerhub * Update dockerhub CI * Update DockerHub * fixed bugs * fixed CI Bugs * Update auto_lang.yml Signed-off-by: Suyunmeng <sumengjing@outlook.com> * fixed release Signed-off-by: Suyunmeng <sumengjing@outlook.com> * Update test_docker.yml Signed-off-by: Suyunmeng <sumengjing@outlook.com> * Delete hub Signed-off-by: Suyunmeng <sumengjing@outlook.com> * Delete hub Signed-off-by: Suyunmeng <sumengjing@outlook.com> * test build Signed-off-by: Suyunmeng <sumengjing@outlook.com> * Simplify actions Signed-off-by: Suyunmeng <sumengjing@outlook.com> * Simplify actions test Signed-off-by: Suyunmeng <sumengjing@outlook.com> * Simplify actions test Successful ,Rollback Environments Signed-off-by: Suyunmeng <sumengjing@outlook.com> * Update release_docker.yml Signed-off-by: Suyunmeng <sumengjing@outlook.com> * Update test_docker.yml Signed-off-by: Suyunmeng <sumengjing@outlook.com> * Update auto_lang.yml Signed-off-by: Suyunmeng <sumengjing@outlook.com> * Update auto_lang.yml Signed-off-by: Suyunmeng <sumengjing@outlook.com> * Update auto_lang.yml Signed-off-by: Suyunmeng <sumengjing@outlook.com> * Update test_docker.yml Signed-off-by: Suyunmeng <sumengjing@outlook.com> * Update release_docker.yml Signed-off-by: Suyunmeng <sumengjing@outlook.com> --------- Signed-off-by: Suyunmeng <sumengjing@outlook.com>
1 parent d95c4f0 commit 2e889fb

File tree

3 files changed

+29
-16
lines changed

3 files changed

+29
-16
lines changed

.github/workflows/auto_lang.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ jobs:
3333
- name: Checkout alist
3434
uses: actions/checkout@v4
3535
with:
36-
path: openlist
36+
path: OpenList
3737

38-
- name: Checkout openlist-frontend
38+
- name: Checkout OpenList-Frontend
3939
uses: actions/checkout@v4
4040
with:
4141
repository: 'OpenListTeam/OpenList-Frontend'
@@ -46,13 +46,13 @@ jobs:
4646

4747
- name: Generate lang
4848
run: |
49-
cd openlist
49+
cd OpenList
5050
go run ./main.go lang
5151
cd ..
5252
5353
- name: Copy lang file
5454
run: |
55-
cp -f ./openlist/lang/*.json ./OpenList-Frontend/src/lang/en/ 2>/dev/null || :
55+
cp -f ./OpenList/lang/*.json ./OpenList-Frontend/src/lang/en/ 2>/dev/null || :
5656
5757
- name: Commit git
5858
run: |

.github/workflows/release_docker.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,14 @@ concurrency:
1212

1313
env:
1414
ORG_NAME: openlistteam
15-
IMAGE_NAME: openlist
15+
IMAGE_NAME: openlist-git
16+
IMAGE_NAME_DOCKERHUB: openlist
1617
REGISTRY: ghcr.io
1718
ARTIFACT_NAME: 'binaries_docker_release'
1819
RELEASE_PLATFORMS: 'linux/amd64,linux/arm64,linux/arm/v7,linux/386,linux/arm/v6,linux/s390x,linux/ppc64le,linux/riscv64'
1920
IMAGE_PUSH: ${{ github.event_name == 'push' }}
2021
IMAGE_IS_PROD: ${{ github.ref_type == 'tag' }}
2122
IMAGE_TAGS_BETA: |
22-
type=schedule
23-
type=ref,event=branch
24-
type=ref,event=tag
25-
type=ref,event=pr
2623
type=raw,value=beta,enable={{is_default_branch}}
2724
2825
jobs:
@@ -110,11 +107,20 @@ jobs:
110107
username: ${{ github.actor }}
111108
password: ${{ secrets.GITHUB_TOKEN }}
112109

110+
- name: Login to DockerHub Container Registry
111+
if: env.IMAGE_PUSH == 'true'
112+
uses: docker/login-action@v3
113+
with:
114+
username: ${{ env.ORG_NAME }}
115+
password: ${{ secrets.DOCKERHUB_TOKEN }}
116+
113117
- name: Docker meta
114118
id: meta
115119
uses: docker/metadata-action@v5
116120
with:
117-
images: ${{ env.REGISTRY }}/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}
121+
images: |
122+
${{ env.REGISTRY }}/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}
123+
${{ env.ORG_NAME }}/${{ env.IMAGE_NAME_DOCKERHUB }}
118124
tags: ${{ env.IMAGE_IS_PROD == 'true' && '' || env.IMAGE_TAGS_BETA }}
119125
flavor: |
120126
${{ env.IMAGE_IS_PROD == 'true' && 'latest=true' || '' }}
@@ -130,4 +136,4 @@ jobs:
130136
build-args: ${{ matrix.build_arg }}
131137
tags: ${{ steps.meta.outputs.tags }}
132138
labels: ${{ steps.meta.outputs.labels }}
133-
platforms: ${{ env.RELEASE_PLATFORMS }}
139+
platforms: ${{ env.RELEASE_PLATFORMS }}

.github/workflows/test_docker.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ concurrency:
1616
env:
1717
ORG_NAME: openlistteam
1818
IMAGE_NAME: openlist-git
19+
IMAGE_NAME_DOCKERHUB: openlist
1920
REGISTRY: ghcr.io
2021
ARTIFACT_NAME: 'binaries_docker_release'
2122
RELEASE_PLATFORMS: 'linux/amd64,linux/arm64,linux/arm/v7,linux/386,linux/arm/v6,linux/s390x,linux/ppc64le,linux/riscv64'
2223
IMAGE_PUSH: ${{ github.event_name == 'push' }}
2324
IMAGE_TAGS_BETA: |
24-
type=schedule
25-
type=ref,event=branch
26-
type=ref,event=tag
2725
type=ref,event=pr
2826
type=raw,value=beta,enable={{is_default_branch}}
2927
@@ -110,11 +108,20 @@ jobs:
110108
username: ${{ github.actor }}
111109
password: ${{ secrets.GITHUB_TOKEN }}
112110

111+
- name: Login to DockerHub Container Registry
112+
if: env.IMAGE_PUSH == 'true'
113+
uses: docker/login-action@v3
114+
with:
115+
username: ${{ env.ORG_NAME }}
116+
password: ${{ secrets.DOCKERHUB_TOKEN }}
117+
113118
- name: Docker meta
114119
id: meta
115120
uses: docker/metadata-action@v5
116121
with:
117-
images: ${{ env.REGISTRY }}/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}
122+
images: |
123+
${{ env.REGISTRY }}/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}
124+
${{ env.ORG_NAME }}/${{ env.IMAGE_NAME_DOCKERHUB }}
118125
tags: ${{ env.IMAGE_TAGS_BETA }}
119126
flavor: |
120127
${{ matrix.tag_favor }}
@@ -129,4 +136,4 @@ jobs:
129136
build-args: ${{ matrix.build_arg }}
130137
tags: ${{ steps.meta.outputs.tags }}
131138
labels: ${{ steps.meta.outputs.labels }}
132-
platforms: ${{ env.RELEASE_PLATFORMS }}
139+
platforms: ${{ env.RELEASE_PLATFORMS }}

0 commit comments

Comments
 (0)