Skip to content

Commit 7263f1a

Browse files
committed
chore: update workflows config.
1 parent b562a8f commit 7263f1a

File tree

1 file changed

+137
-137
lines changed

1 file changed

+137
-137
lines changed

.github/workflows/ci.yml

Lines changed: 137 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -6,141 +6,141 @@ on:
66

77
jobs:
88
build-deploy:
9-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v3
12-
- uses: actions/setup-node@v3
13-
with:
14-
node-version: 16
15-
16-
- name: Generate Contributors Images
17-
uses: jaywcjlove/github-action-contributors@main
18-
with:
19-
filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\])
20-
avatarSize: 42
21-
22-
- name: Build Linux Command
23-
run: |
24-
npm install
25-
npm run dash
26-
cp CONTRIBUTORS.svg .deploy
27-
rm -rf .deploy/linux-command.docset
28-
29-
- name: Create Tag
30-
id: create_tag
31-
uses: jaywcjlove/create-tag-action@v1.3.6
32-
with:
33-
package-path: ./package.json
34-
35-
- name: Get Tag Version
36-
id: tag_version
37-
uses: jaywcjlove/changelog-generator@v1.5.3
38-
39-
- name: Update Dash Feed
40-
run: |
41-
echo "<entry><version>${{steps.create_tag.outputs.versionNumber}}</version><url>https://jaywcjlove.github.io/linux-command/linux-command.docset.tgz</url></entry>" > .deploy/linux-command-docset.xml
42-
43-
- name: Deploy
44-
uses: peaceiris/actions-gh-pages@v3
45-
with:
46-
commit_message: '[${{steps.tag_version.outputs.tag}}] ${{ github.event.head_commit.message }}'
47-
github_token: ${{ secrets.GITHUB_TOKEN }}
48-
publish_dir: ./.deploy
49-
user_name: github-actions[bot]
50-
user_email: github-actions[bot]@users.noreply.github.com
51-
52-
- name: Generate Changelog
53-
id: changelog
54-
uses: jaywcjlove/changelog-generator@v1.5.3
55-
with:
56-
filter-author: (小弟调调™)
57-
filter: (^[\s]+?[R|r]elease)|(^[R|r]elease)
58-
59-
- name: Create Release
60-
uses: ncipollo/release-action@v1
61-
if: steps.create_tag.outputs.successful
62-
with:
63-
artifacts: '.deploy/linux-command.docset.tgz'
64-
token: ${{ secrets.GITHUB_TOKEN }}
65-
name: ${{ steps.create_tag.outputs.version }}
66-
tag: ${{ steps.create_tag.outputs.version }}
67-
body: |
68-
[![](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/linux-command@${{steps.create_tag.outputs.versionNumber}}/file/README.md) [![npm bundle size](https://img.shields.io/bundlephobia/minzip/linux-command)](https://bundlephobia.com/result?p=linux-command@${{steps.create_tag.outputs.versionNumber}})
69-
70-
```bash
71-
npm i linux-command@${{steps.create_tag.outputs.versionNumber}}
72-
```
73-
74-
${{ steps.changelog.outputs.compareurl }}
75-
76-
${{ steps.changelog.outputs.changelog }}
77-
78-
79-
Document linux-command@${{ steps.changelog.outputs.tag }}:
80-
https://raw.githack.com/jaywcjlove/linux-command/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
81-
82-
83-
## Docker
84-
85-
[![Docker Image Version (latest by date)](https://img.shields.io/docker/v/wcjiang/linux-command)](https://hub.docker.com/r/wcjiang/linux-command) [![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/wcjiang/linux-command)](https://hub.docker.com/r/wcjiang/linux-command) [![Docker Pulls](https://img.shields.io/docker/pulls/wcjiang/linux-command)](https://hub.docker.com/r/wcjiang/linux-command)
86-
87-
轻松通过 `docker` 部署 `linux-command` 网站。
88-
89-
```bash
90-
docker pull wcjiang/linux-command
91-
```
92-
93-
```bash
94-
docker run --name linux-command --rm -d -p 9665:3000 wcjiang/linux-command:latest
95-
# Or
96-
docker run --name linux-command -itd -p 9665:3000 wcjiang/linux-command:latest
97-
```
98-
99-
在浏览器中访问以下 URL
100-
101-
```bash
102-
http://localhost:9665/
103-
```
104-
105-
- name: Push Npm
106-
run: |
107-
npm install @jsdevtools/npm-publish -g
108-
npm-publish --token="${{ secrets.NPM_TOKEN }}" ./package.json
109-
110-
# Create Docker Image
111-
- name: Docker login
112-
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
113-
114-
- name: Build linux-command image
115-
run: |
116-
rm -rf .deploy/linux-command.docset.tgz
117-
docker image build -t linux-command .
118-
119-
- name: Tags & Push image(latest)
120-
run: |
121-
docker tag linux-command ${{ secrets.DOCKER_USER }}/linux-command:latest
122-
docker push ${{ secrets.DOCKER_USER }}/linux-command:latest
123-
124-
- name: Tags & Push image
125-
if: steps.create_tag.outputs.successful
126-
run: |
127-
echo "outputs.tag - ${{ steps.changelog.outputs.version }}"
128-
docker tag linux-command ${{ secrets.DOCKER_USER }}/linux-command:${{steps.changelog.outputs.version}}
129-
docker push ${{ secrets.DOCKER_USER }}/linux-command:${{steps.changelog.outputs.version}}
130-
131-
# Create Docker Image in Github
132-
- name: Login to GitHub registry
133-
run: echo ${{ github.token }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
134-
135-
- name: Build docker image
136-
run: docker build -t ghcr.io/jaywcjlove/linux-command:latest .
137-
138-
- name: Publish to GitHub registry
139-
run: docker push ghcr.io/jaywcjlove/linux-command:latest
140-
141-
- name: Tag docker image (beta) and publish to GitHub registry
142-
if: steps.create_tag.outputs.successful
143-
run: |
144-
echo "version: v${{ steps.changelog.outputs.version }}"
145-
docker tag ghcr.io/jaywcjlove/linux-command:latest ghcr.io/jaywcjlove/linux-command:${{steps.changelog.outputs.version}}
146-
docker push ghcr.io/jaywcjlove/linux-command:${{steps.changelog.outputs.version}}
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
13+
with:
14+
node-version: 16
15+
16+
- name: Generate Contributors Images
17+
uses: jaywcjlove/github-action-contributors@main
18+
with:
19+
filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\])
20+
avatarSize: 42
21+
22+
- name: Build Linux Command
23+
run: |
24+
npm install
25+
npm run dash
26+
cp CONTRIBUTORS.svg .deploy
27+
rm -rf .deploy/linux-command.docset
28+
29+
- name: Create Tag
30+
id: create_tag
31+
uses: jaywcjlove/create-tag-action@main
32+
with:
33+
package-path: ./package.json
34+
35+
- name: Get Tag Version
36+
id: tag_version
37+
uses: jaywcjlove/changelog-generator@main
38+
39+
- name: Update Dash Feed
40+
run: |
41+
echo "<entry><version>${{steps.create_tag.outputs.versionNumber}}</version><url>https://jaywcjlove.github.io/linux-command/linux-command.docset.tgz</url></entry>" > .deploy/linux-command-docset.xml
42+
43+
- name: Deploy
44+
uses: peaceiris/actions-gh-pages@v3
45+
with:
46+
commit_message: '[${{steps.tag_version.outputs.tag}}] ${{ github.event.head_commit.message }}'
47+
github_token: ${{ secrets.GITHUB_TOKEN }}
48+
publish_dir: ./.deploy
49+
user_name: github-actions[bot]
50+
user_email: github-actions[bot]@users.noreply.github.com
51+
52+
- name: Generate Changelog
53+
id: changelog
54+
uses: jaywcjlove/changelog-generator@main
55+
with:
56+
filter-author: (小弟调调™)
57+
filter: (^[\s]+?[R|r]elease)|(^[R|r]elease)
58+
59+
- name: Create Release
60+
uses: ncipollo/release-action@v1
61+
if: steps.create_tag.outputs.successful
62+
with:
63+
artifacts: '.deploy/linux-command.docset.tgz'
64+
token: ${{ secrets.GITHUB_TOKEN }}
65+
name: ${{ steps.create_tag.outputs.version }}
66+
tag: ${{ steps.create_tag.outputs.version }}
67+
body: |
68+
[![](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/linux-command@${{steps.create_tag.outputs.versionNumber}}/file/README.md) [![npm bundle size](https://img.shields.io/bundlephobia/minzip/linux-command)](https://bundlephobia.com/result?p=linux-command@${{steps.create_tag.outputs.versionNumber}})
69+
70+
```bash
71+
npm i linux-command@${{steps.create_tag.outputs.versionNumber}}
72+
```
73+
74+
${{ steps.changelog.outputs.compareurl }}
75+
76+
${{ steps.changelog.outputs.changelog }}
77+
78+
79+
Document linux-command@${{ steps.changelog.outputs.tag }}:
80+
https://raw.githack.com/jaywcjlove/linux-command/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
81+
82+
83+
## Docker
84+
85+
[![Docker Image Version (latest by date)](https://img.shields.io/docker/v/wcjiang/linux-command)](https://hub.docker.com/r/wcjiang/linux-command) [![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/wcjiang/linux-command)](https://hub.docker.com/r/wcjiang/linux-command) [![Docker Pulls](https://img.shields.io/docker/pulls/wcjiang/linux-command)](https://hub.docker.com/r/wcjiang/linux-command)
86+
87+
轻松通过 `docker` 部署 `linux-command` 网站。
88+
89+
```bash
90+
docker pull wcjiang/linux-command
91+
```
92+
93+
```bash
94+
docker run --name linux-command --rm -d -p 9665:3000 wcjiang/linux-command:latest
95+
# Or
96+
docker run --name linux-command -itd -p 9665:3000 wcjiang/linux-command:latest
97+
```
98+
99+
在浏览器中访问以下 URL
100+
101+
```bash
102+
http://localhost:9665/
103+
```
104+
105+
- name: Push Npm
106+
run: |
107+
npm install @jsdevtools/npm-publish -g
108+
npm-publish --token="${{ secrets.NPM_TOKEN }}" ./package.json
109+
110+
# Create Docker Image
111+
- name: Docker login
112+
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
113+
114+
- name: Build linux-command image
115+
run: |
116+
rm -rf .deploy/linux-command.docset.tgz
117+
docker image build -t linux-command .
118+
119+
- name: Tags & Push image(latest)
120+
run: |
121+
docker tag linux-command ${{ secrets.DOCKER_USER }}/linux-command:latest
122+
docker push ${{ secrets.DOCKER_USER }}/linux-command:latest
123+
124+
- name: Tags & Push image
125+
if: steps.create_tag.outputs.successful
126+
run: |
127+
echo "outputs.tag - ${{ steps.changelog.outputs.version }}"
128+
docker tag linux-command ${{ secrets.DOCKER_USER }}/linux-command:${{steps.changelog.outputs.version}}
129+
docker push ${{ secrets.DOCKER_USER }}/linux-command:${{steps.changelog.outputs.version}}
130+
131+
# Create Docker Image in Github
132+
- name: Login to GitHub registry
133+
run: echo ${{ github.token }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
134+
135+
- name: Build docker image
136+
run: docker build -t ghcr.io/jaywcjlove/linux-command:latest .
137+
138+
- name: Publish to GitHub registry
139+
run: docker push ghcr.io/jaywcjlove/linux-command:latest
140+
141+
- name: Tag docker image (beta) and publish to GitHub registry
142+
if: steps.create_tag.outputs.successful
143+
run: |
144+
echo "version: v${{ steps.changelog.outputs.version }}"
145+
docker tag ghcr.io/jaywcjlove/linux-command:latest ghcr.io/jaywcjlove/linux-command:${{steps.changelog.outputs.version}}
146+
docker push ghcr.io/jaywcjlove/linux-command:${{steps.changelog.outputs.version}}

0 commit comments

Comments
 (0)