feat(host-manager): add some metrics (#950) #810
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
name: Release | |
on: | |
push: | |
branches: ['main'] | |
# manually trigger | |
workflow_dispatch: | |
inputs: | |
rebuild: | |
type: string | |
description: 'Rebuild All Packages' | |
required: false | |
default: 'false' | |
jobs: | |
build: | |
uses: ./.github/workflows/ci.yml | |
with: | |
rebuild: ${{ inputs.rebuild == 'true' }} | |
secrets: | |
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
gh-pages-global: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: web-artifacts | |
path: ./ui/web/dist | |
- name: Deploy UI Web on gh-pages | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
external_repository: No-Trade-No-Life/No-Trade-No-Life.github.io | |
publish_branch: main | |
publish_dir: ./ui/web/dist | |
cname: y.ntnl.io | |
gh-pages-cn: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: web-artifacts | |
path: ./ui/web/dist | |
- name: Deploy UI Web on gh-pages | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY_CN }} | |
external_repository: No-Trade-No-Life/gh-pages-cn | |
publish_branch: main | |
publish_dir: ./ui/web/dist | |
cname: y.ntnl.tech | |
gh-pages-docs-global: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: docs-artifacts | |
path: ./ui/docs/build | |
- name: Deploy UI Web on gh-pages | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY_DOC }} | |
external_repository: No-Trade-No-Life/home-page | |
publish_branch: main | |
publish_dir: ./ui/docs/build | |
cname: www.ntnl.io | |
docker-build: | |
runs-on: ubuntu-latest | |
needs: build | |
if: ${{ needs.build.outputs.bake_file_existence == 'true' }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: docker-artifacts | |
continue-on-error: true | |
- run: | | |
tar -zxvf docker-deploy.tar.gz | |
continue-on-error: true | |
- name: Check docker bake file existence | |
id: check_files | |
uses: andstor/file-existence-action@v2 | |
with: | |
files: './common/temp/docker-bake.json' | |
- name: Cache Docker layers | |
uses: actions/cache@v3 | |
id: cache | |
if: ${{ steps.check_files.outputs.files_exists == 'true' }} | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
id: buildx | |
if: ${{ steps.check_files.outputs.files_exists == 'true' }} | |
- name: Login to GHCR | |
uses: docker/login-action@v2 | |
if: ${{ steps.check_files.outputs.files_exists == 'true' }} | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build And Push Image | |
uses: docker/bake-action@v1.1.3 | |
if: ${{ steps.check_files.outputs.files_exists == 'true' }} | |
with: | |
push: true | |
files: ./common/temp/docker-bake.json | |
# npm-publish: | |
# runs-on: ubuntu-latest | |
# needs: build | |
# if: ${{ github.event_name == 'workflow_dispatch' }} | |
# steps: | |
# - uses: actions/checkout@v3 | |
# with: | |
# fetch-depth: 0 | |
# - name: Get artifact | |
# uses: actions/download-artifact@v3 | |
# with: | |
# name: npm-artifacts |