Skip to content

build. feedly/

build. feedly/ #89

Workflow file for this run

name: Build
on:
push:
branches:
- main
paths:
- 'packages/**'
# - 'dist/**'
- 'site-astro/**'
jobs:
def:
runs-on: ubuntu-latest
env:
TZ: Asia/Shanghai
steps:
# Checkout
- name: Checkout
uses: actions/checkout@v4
# Get Post Changes
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
with:
files_yaml: |
packages:
- 'packages/**'
# List all changed files
- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.packages_all_changed_files }}; do
echo "$file was changed"
done
# Setup Node
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18'
# Install pnpm && Build Packages
- name: Install pnpm && Build Packages
if: steps.changed-files.outputs.packages_any_changed == 'true'
run: |
npm install -g pnpm
pnpm install
pnpm -r --filter=./packages/* install
pnpm -r --filter=./packages/* run build
# Setup Python
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pipenv'
# Install pipenv and dependencies
- name: Install pipenv and dependencies
run: |
pip3 install --user pipenv
pipenv --python python3 && pipenv install
# Pipenv Build
- name: Pipenv Build
env:
GIT_CHANGED_FILES: ${{ steps.changed-files.outputs.packages_all_changed_files }}
run: |
pipenv run build
# Install Deps && Build Astro
- name: Install Deps && Build Astro
run: |
cd site-astro
npm install
npm run build
# 写入 .nojekyll 到 docs 目录
cd .. && touch docs/.nojekyll
# Commit Changes To Git
- name: Commit files
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git status
# git diff-index --quiet HEAD || (git commit -m "Auto Commit" -a --no-verify)
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "Auto Commit" -a --no-verify
fi
# Push Changes To Git
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}