-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UPDATE: Github Actions publish and release
- Loading branch information
Showing
4 changed files
with
108 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Publish NPM Package | ||
|
||
on: | ||
push: | ||
tags: | ||
- ng-* | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 检出 | ||
uses: actions/checkout@v3 | ||
|
||
- name: 安装 Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
registry-url: https://registry.npmjs.org | ||
cache: 'npm' | ||
|
||
- name: 安装依赖 | ||
run: npm ci | ||
|
||
- name: 构建 Angular 库 | ||
run: | | ||
npm run build:ng | ||
- name: 发布至 NPM | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | ||
run: | | ||
cd ./dist/angular | ||
npm version ${{github.ref_name}} | ||
npm publish --access=public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
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@v3 | ||
- 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@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Login TCR | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.TCR_REGISTRY }} | ||
username: ${{ secrets.TCR_USERNAME }} | ||
password: ${{ secrets.TCR_PASSWORD }} | ||
|
||
- name: Get Metadata | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Push | ||
uses: docker/build-push-action@v2 | ||
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}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM node:18-alpine | ||
|
||
COPY dist /app/dist | ||
WORKDIR /app | ||
|
||
EXPOSE 4200 | ||
|
||
CMD [ "node", "dist/console/server/main.js" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters