Skip to content

Commit 2277b9b

Browse files
committed
chore: push nightly image to ghcr.io
1 parent 9e7b3de commit 2277b9b

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

.github/workflows/dockerhub-publish-nightly.yml

+13-6
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,35 @@ on:
55
schedule:
66
- cron: '10 20 * * *'
77

8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
12+
813
jobs:
914
docker:
1015
if: github.repository_owner == 'CeresDB'
1116
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: write
1220
steps:
1321
- name: Checkout
1422
uses: actions/checkout@v3
1523
- name: Set up Docker Buildx
1624
uses: docker/setup-buildx-action@v2
17-
- name: Login to DockerHub
25+
- name: Login to Container Registry
1826
uses: docker/login-action@v2
1927
with:
20-
username: ${{ secrets.DOCKERHUB_USERNAME }}
21-
password: ${{ secrets.DOCKERHUB_TOKEN }}
28+
registry: ${{ env.REGISTRY }}
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
2231
- name: Set Environment Variables
2332
run: |
2433
echo "BUILD_DATE=$(TZ=':Asia/Shanghai' date '+%Y%m%d')" >> $GITHUB_ENV
25-
# only first 7 chars of commit id
26-
echo "COMMIT_ID=${GITHUB_SHA::7}" >> $GITHUB_ENV
2734
- name: Build and Push CeresDB Server Docker Image
2835
uses: docker/build-push-action@v3
2936
with:
3037
context: .
3138
push: true
32-
tags: ceresdb/ceresdb-server:nightly-${{ env.BUILD_DATE }}-${{ env.COMMIT_ID }}
39+
tags: ceresdb/ceresdb-server:nightly-${{ env.BUILD_DATE }}

0 commit comments

Comments
 (0)