-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (40 loc) · 1.26 KB
/
docker-image.yml
File metadata and controls
41 lines (40 loc) · 1.26 KB
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
name: ci
on:
push:
branches: [ main ]
schedule:
- cron: "15 16 * * *" # 北京时间0点01分执行
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: cd docs && npm i && npm run build
- name: Login to Huawei Cloud SWR
uses: huaweicloud/swr-login@v2.1.0
with:
region: cn-north-4
access-key-id: ${{ secrets.ACCESSKEY }}
access-key-secret: ${{ secrets.SECRETACCESSKEY }}
- name: Get current date
id: date
run: echo "::set-output name=today::$(date +'%Y-%m-%d')"
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: |
swr.cn-north-4.myhuaweicloud.com/lomtom/algorithm:${{ steps.date.outputs.today }}
swr.cn-north-4.myhuaweicloud.com/lomtom/algorithm:latest
- name: redeploy
run: |
curl -u ${{ secrets.WEBHOOK_USER_PASS }} https://webhook.lomtom.cn/hooks/redeploy-webhook