-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
78 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,22 +15,57 @@ jobs: | |
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/[email protected] | ||
with: | ||
version: 7 | ||
|
||
- name: Checkout Master | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: 'mouday/spider-admin-pro' | ||
ref: 'master' | ||
path: 'spider_admin_pro' | ||
|
||
# 拉取web前端dist的代码 | ||
- name: Checkout Web Dist | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: 'mouday/spider-admin-pro-web' | ||
ref: 'master' | ||
token: ${{ secrets.GH_PAT }} | ||
path: 'spider_admin_pro_web' | ||
|
||
- name: Build Web | ||
run: | | ||
cd spider_admin_pro_web | ||
pnpm install --no-frozen-lockfile | ||
pnpm run build:prod | ||
mkdir -p ../spider_admin_pro/spider_admin_pro/public | ||
cp -r ./dist/* ../spider_admin_pro/spider_admin_pro/public/ | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: mouday/spider-admin-pro | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
# https://github.com/docker/build-push-action | ||
- name: Build Docker Image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
context: "{{defaultContext}}:spider-admin-pro" | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,24 +22,57 @@ jobs: | |
id-token: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Checkout Master | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: 'mouday/spider-admin-pro' | ||
ref: 'master' | ||
path: 'spider_admin_pro' | ||
|
||
# 拉取web前端dist的代码 | ||
- name: Checkout Web Dist | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: 'mouday/spider-admin-pro-web' | ||
ref: 'master' | ||
token: ${{ secrets.GH_PAT }} | ||
path: 'spider_admin_pro_web' | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/[email protected] | ||
with: | ||
version: 7 | ||
|
||
- name: Build Web | ||
run: | | ||
cd spider_admin_pro_web | ||
pnpm install --no-frozen-lockfile | ||
pnpm run build:prod | ||
mkdir -p ../spider_admin_pro/spider_admin_pro/public | ||
cp -r ./dist/* ../spider_admin_pro/spider_admin_pro/public/ | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
cd spider_admin_pro | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build | ||
run: | | ||
python setup.py sdist bdist_wheel --python-tag py2.py3 | ||
twine check dist/* | ||
python setup.py sdist bdist_wheel --python-tag py2.py3 | ||
twine check dist/* | ||
# Publishing with a Trusted Publisher | ||
# https://docs.pypi.org/trusted-publishers/using-a-publisher/ | ||
# https://github.com/pypa/gh-action-pypi-publish/ | ||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
packages-dir: spider_admin_pro/dist/ |