Skip to content

update: actions & docker #17

update: actions & docker

update: actions & docker #17

Workflow file for this run

name: Release Console Container
on:
push:
tags:
- v*
env:
REGISTRY: ghcr.io
TCR_REGISTRY: ccr.ccs.tencentyun.com
IMAGE_NAME: ${{ github.repository }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: https://registry.npmjs.org
cache: 'npm'
- run: npm ci
- run: npm run build:ssr
- name: Login GitHub Container Hub
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login TCR
uses: docker/login-action@v2
with:
registry: ${{ env.TCR_REGISTRY }}
username: ${{ secrets.TCR_USERNAME }}
password: ${{ secrets.TCR_PASSWORD }}
- name: Get Metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Push
uses: docker/build-push-action@v5
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}}