-
Notifications
You must be signed in to change notification settings - Fork 404
84 lines (73 loc) · 2.21 KB
/
release-server.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: 'publish @waline/vercel'
on:
workflow_dispatch:
push:
branches:
- main
paths:
- .github/workflows/release-server.yml
- packages/server/**
permissions:
contents: write
id-token: write
jobs:
npm:
runs-on: ubuntu-latest
outputs:
old-version: ${{ steps.publish-server.outputs.old-version }}
version: ${{ steps.publish-server.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- id: publish-server
name: 'publish @waline/vercel'
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/server
docker:
needs: npm
if: ${{ needs.npm.outputs.old-version != needs.npm.outputs.version || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push alpine
uses: docker/build-push-action@v5
with:
file: ./packages/server/Dockerfile.alpine
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
lizheming/waline:alpine
lizheming/waline:${{ needs.npm.outputs.version }}-alpine
- name: Build and push debian
uses: docker/build-push-action@v5
with:
file: ./packages/server/Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
lizheming/waline:latest
lizheming/waline:${{ needs.npm.outputs.version }}