Skip to content

Commit

Permalink
update: release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kainonly committed Sep 14, 2023
1 parent 8845f11 commit 80a96c9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
36 changes: 15 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release Console Container
name: Release

on:
push:
Expand All @@ -7,11 +7,11 @@ on:

env:
REGISTRY: ghcr.io
TCR_REGISTRY: ccr.ccs.tencentyun.com
ACR_REGISTRY: registry.cn-shenzhen.aliyuncs.com
IMAGE_NAME: ${{ github.repository }}

jobs:
deploy:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -23,38 +23,32 @@ jobs:
- run: npm ci
- run: npm run build:ssr

- name: Login GitHub Container Hub
uses: docker/login-action@v2
- name: Login GitHub
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login TCR
uses: docker/login-action@v2
- name: Login ACR
uses: docker/login-action@v3
with:
registry: ${{ env.TCR_REGISTRY }}
username: ${{ secrets.TCR_USERNAME }}
password: ${{ secrets.TCR_PASSWORD }}
registry: ${{ env.ACR_REGISTRY }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}

- name: Get Metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
${{ env.ACR_REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Push
uses: docker/build-push-action@v5
- name: Push Images
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Copy to QCLOUD TCR
uses: akhilerm/[email protected]
with:
src: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{steps.meta.outputs.version}}
dst: |
${{ env.TCR_REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.TCR_REGISTRY }}/${{ env.IMAGE_NAME }}:${{steps.meta.outputs.version}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ testem.log
# System files
.DS_Store
Thumbs.db
config

0 comments on commit 80a96c9

Please sign in to comment.