Skip to content

Commit fe5205e

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

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

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

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

8+
env:
9+
REGISTRY: ghcr.io
10+
811
jobs:
912
docker:
1013
if: github.repository_owner == 'CeresDB'
1114
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
1218
steps:
1319
- name: Checkout
1420
uses: actions/checkout@v3
1521
- name: Set up Docker Buildx
1622
uses: docker/setup-buildx-action@v2
17-
- name: Login to DockerHub
23+
- name: Login to Container Registry
1824
uses: docker/login-action@v2
1925
with:
20-
username: ${{ secrets.DOCKERHUB_USERNAME }}
21-
password: ${{ secrets.DOCKERHUB_TOKEN }}
26+
registry: ${{ env.REGISTRY }}
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
2229
- name: Set Environment Variables
2330
run: |
2431
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
2732
- name: Build and Push CeresDB Server Docker Image
2833
uses: docker/build-push-action@v3
2934
with:
3035
context: .
3136
push: true
32-
tags: ceresdb/ceresdb-server:nightly-${{ env.BUILD_DATE }}-${{ env.COMMIT_ID }}
37+
tags: ceresdb/ceresdb-server:nightly-${{ env.BUILD_DATE }}

0 commit comments

Comments
 (0)