优化分组tab下划线样式 #57
Workflow file for this run
This file contains hidden or 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: Build and Release | |
| on: | |
| push: | |
| tags: | |
| - 'v[0-9]+.[0-9]+.[0-9]+' # 只匹配标准版本号,如 v1.0.0,不包含 beta | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: '版本号 (例如: v1.0.0)' | |
| required: true | |
| default: 'v1.0.0' | |
| permissions: | |
| contents: write | |
| packages: write | |
| id-token: write # 添加OIDC令牌支持 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: './frontend/package-lock.json' # 指定 package-lock.json 的路径 | |
| - name: Install dependencies | |
| working-directory: ./frontend # 设置工作目录 | |
| run: npm install --legacy-peer-deps | |
| - name: Build | |
| working-directory: ./frontend # 设置工作目录 | |
| run: npm run build | |
| - name: Zip build files | |
| run: | | |
| cd frontend/build | |
| zip -r ../../release.zip . | |
| cd ../.. | |
| - name: Create Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.event.inputs.version }} | |
| files: | | |
| release.zip | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.CR_PAT }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./docker/Dockerfile | |
| platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
| push: true | |
| tags: | | |
| ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.event.inputs.version || github.ref_name }} | |
| ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest | |
| - name: Login to Aliyun Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: registry.cn-hangzhou.aliyuncs.com | |
| username: ${{ secrets.ALIYUN_USERNAME }} | |
| password: ${{ secrets.ALIYUN_PASSWORD }} | |
| - name: Build and push Docker image To Aliyun Container Registry | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./docker/Dockerfile | |
| platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
| push: true | |
| tags: | | |
| registry.cn-hangzhou.aliyuncs.com/hass-panel/${{ github.event.repository.name }}:${{ github.event.inputs.version || github.ref_name }} | |
| registry.cn-hangzhou.aliyuncs.com/hass-panel/${{ github.event.repository.name }}:latest | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
| - name: Build and push Docker image To Docker Hub | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./docker/Dockerfile | |
| platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
| push: true | |
| tags: | | |
| ${{ secrets.DOCKER_HUB_USERNAME }}/${{ github.event.repository.name }}:${{ github.event.inputs.version || github.ref_name }} | |
| ${{ secrets.DOCKER_HUB_USERNAME }}/${{ github.event.repository.name }}:latest | |
| - name: Trigger B Repo Workflow | |
| run: | | |
| curl -X POST -H "Accept: application/vnd.github.v3+json" \ | |
| -H "Authorization: token ${{ secrets.LAO_WANG_GITHUB_TOKEN }}" \ | |
| https://api.github.com/repos/ha-china/hassio-addons/dispatches \ | |
| -d '{"event_type":"external_trigger"}' |