Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mouday committed Jun 7, 2024
1 parent 1ca614d commit 0fb12cf
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 10 deletions.
41 changes: 38 additions & 3 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
47 changes: 40 additions & 7 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/

0 comments on commit 0fb12cf

Please sign in to comment.