From c62200c6f4f4b6ee94798ffc887eec1bbccf646c Mon Sep 17 00:00:00 2001 From: Gao Sun Date: Fri, 24 Jun 2022 15:39:17 +0800 Subject: [PATCH] ci: upload image to ghcr (#1228) --- .github/workflows/dockerize.yml | 23 ++++++++++------------- docker-compose.yml | 2 +- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/dockerize.yml b/.github/workflows/dockerize.yml index 938447ebc..e57fa8d5c 100644 --- a/.github/workflows/dockerize.yml +++ b/.github/workflows/dockerize.yml @@ -6,7 +6,6 @@ on: concurrency: group: dockerize-${{ github.ref }} - cancel-in-progress: true jobs: dockerize: @@ -18,15 +17,19 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Build and export + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: silverhand-bot + password: ${{ secrets.BOT_PAT }} + + - name: Build and push uses: docker/build-push-action@v3 with: context: . - tags: logto - outputs: type=docker,dest=/tmp/logto.tar - - - name: Load image - run: docker load -i /tmp/logto.tar + push: true + tags: ghcr.io/logto-io/logto:latest - name: Compose up run: docker compose up -d @@ -36,9 +39,3 @@ jobs: - name: Health check run: curl http://localhost:3001/api/status -If - - - name: Upload artifact - uses: actions/upload-artifact@v3 - with: - name: logto.${{ github.sha }} - path: /tmp/logto.tar diff --git a/docker-compose.yml b/docker-compose.yml index 1fdf37fa9..c525c9f74 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: app: depends_on: - postgres - image: logto:latest + image: ghcr.io/logto-io/logto:latest ports: - 3001:3001 environment: