Skip to content

build(deps-dev): bump vercel from 37.12.0 to 37.12.1 #54

build(deps-dev): bump vercel from 37.12.0 to 37.12.1

build(deps-dev): bump vercel from 37.12.0 to 37.12.1 #54

Workflow file for this run

name: Release
on:
push:
branches:
- master
# 仅取消针对当前工作流正在进行的作业或运行
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release:
name: Release
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
packages: write
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: "latest"
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "pnpm"
- name: Cache Dependency
uses: actions/cache@v4
with:
path: |
~/.npm
~/.yarn
~/.cache/pnpm
~/cache
!~/cache/exclude
**/node_modules
key: pnpm-${{ runner.os }}-${{ hashFiles('package.json') }}
restore-keys: pnpm-${{ runner.os }}
- run: pnpm i --frozen-lockfile
- run: pnpm run lint
- run: pnpm run build
- env:
# GH_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm run release
# 发布到 docker
- name: Get git tag
run: |
GIT_TAG=$(git describe --tags --exact-match HEAD 2>/dev/null || true)
echo "GIT_TAG=$GIT_TAG" >> ${GITHUB_ENV}
- 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.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to Alibaba Cloud Container Registry
uses: docker/login-action@v3
with:
registry: registry.cn-hangzhou.aliyuncs.com
username: ${{ secrets.ALIYUN_USERNAME }}
password: ${{ secrets.ALIYUN_PASSWORD }}
- name: Extract Docker metadata
id: metadata
uses: docker/metadata-action@v5
with:
# 发布到 docker.io / ghcr.io / registry.cn-hangzhou.aliyuncs.com
images: |
${{ github.repository }}
registry.cn-hangzhou.aliyuncs.com/${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=match,priority=1100,pattern=\d.\d.\d,value=${{env.GIT_TAG}},enable=true
type=raw,value=latest,enable=true
type=raw,value={{date 'YYYY-MM-DD' tz='Asia/Shanghai'}},enable=true
type=sha,format=short,prefix=sha-,enable=true
flavor: latest=false
- name: Build and push Docker images
uses: docker/build-push-action@v5
# 如果有 GIT_TAG ,就发布
if: ${{ env.GIT_TAG }}
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
platforms: linux/amd64,linux/arm64