This repository has been archived by the owner on Jan 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 298
61 lines (51 loc) · 1.82 KB
/
docker-build.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
name: Docker Build and Push
on:
push:
branches:
- main
jobs:
build:
if: contains(github.event.head_commit.message, '[skip ci]') == false
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: SetUp Node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- name: Install devDependencies
run: npm install --only=dev
- name: Generate changelog and push changes
run: |
npm run release
git config --global user.email "[email protected]"
git config --global user.name "gitHubCi"
git add .
git commit -m "Commit changes for release"
git push origin main
- name: Get Package Version
id: get_version
run: echo "::set-output name=package_version::$(node -p "require('./package.json').version")"
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.get_version.outputs.package_version }}
release_name: Release v${{ steps.get_version.outputs.package_version }}
body: |
更新内容参见 [CHANGELOG](https://github.com/danni-cool/docker-wechatbot-webhook/blob/main/CHANGELOG.md)
draft: false
prerelease: false
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: dannicool
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Docker Image
run: |
docker build . -t dannicool/docker-wechatbot-webhook:latest
docker push dannicool/docker-wechatbot-webhook:latest