better workflow, imagemagick is V6 in ubuntu latest
This commit is contained in:
@@ -18,39 +18,31 @@ jobs:
|
|||||||
username: ${{ VARS.USER }}
|
username: ${{ VARS.USER }}
|
||||||
password: ${{ secrets.TOKEN }}
|
password: ${{ secrets.TOKEN }}
|
||||||
|
|
||||||
# --- ADDED: Step to generate image assets before the build ---
|
|
||||||
- name: Generate Static Image Assets
|
- name: Generate Static Image Assets
|
||||||
run: |
|
uses: add-actions/run-in-container@v1
|
||||||
# Install dependencies required by the scripts
|
with:
|
||||||
sudo apt-get update && sudo apt-get install -y imagemagick webp
|
image: archlinux:latest
|
||||||
|
run: |
|
||||||
# Make scripts executable
|
pacman -Syu --noconfirm imagemagick webp ghostscript
|
||||||
chmod +x ./scripts/*.sh
|
chmod +x ./scripts/*.sh
|
||||||
|
bash ./scripts/first_page_image.sh
|
||||||
# Run the scripts to generate PNGs from PDFs and create WebP images
|
bash ./scripts/generate_webp.sh
|
||||||
echo "Generating PNGs from PDFs..."
|
|
||||||
bash ./scripts/first_page_image.sh
|
|
||||||
echo "Generating WebP images..."
|
|
||||||
bash ./scripts/generate_webp.sh
|
|
||||||
|
|
||||||
# --- REPLACED: The following steps are changed from Ruby/Jekyll to Node.js/Next.js ---
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20.x' # Use a current LTS version of Node.js
|
node-version: '20.x'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install Node.js Dependencies
|
- name: Install Node.js Dependencies
|
||||||
run: npm ci # 'npm ci' is recommended for CI for faster, reliable installs
|
run: npm ci
|
||||||
|
|
||||||
- name: Build Next.js App
|
- name: Build Next.js App
|
||||||
run: npm run build
|
run: npm run build
|
||||||
# --- END OF REPLACED STEPS ---
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
# --- UNCHANGED: This step remains the same as requested ---
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user