mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 13:24:51 +08:00
Simplify build actions
This commit is contained in:
parent
da0b052cc2
commit
3c96621af4
41
.github/workflows/build-php.yml
vendored
41
.github/workflows/build-php.yml
vendored
@ -13,39 +13,20 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: [ "7.2.34", "7.3.33", "7.4.27", "8.0.15", "8.1.4" ]
|
||||
arch: [ "x86_64", "aarch64", "armv7l" ]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build PHP ${{ matrix.php-versions }}
|
||||
run: cd docker/ && docker build . --file Dockerfile --tag static-php --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=${{ matrix.php-versions }}
|
||||
- name: Push PHP ${{ matrix.php-versions }} to dist
|
||||
- name: Check Dockerfile to ${{ matrix.arch }}
|
||||
run: |
|
||||
mkdir dist && docker run --rm -v $(pwd)/dist:/dist/ static-php cp php-dist/bin/php /dist/
|
||||
cd dist && tar -zcvf "php-${{ matrix.php-versions }}-static-bin-x86_64.tar.gz" ./php && rm ./php
|
||||
- name: Deploy to Zhamao Server
|
||||
uses: easingthemes/ssh-deploy@main
|
||||
env:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SERVER_SECRET_KEY }}
|
||||
ARGS: "-rltgoDzvO"
|
||||
SOURCE: "dist/"
|
||||
REMOTE_HOST: ${{ secrets.DEPLOY_SERVER_HOST }}
|
||||
REMOTE_PORT: ${{ secrets.DEPLOY_SERVER_PORT }}
|
||||
REMOTE_USER: ${{ secrets.DEPLOY_SERVER_USER }}
|
||||
TARGET: ${{ secrets.DEPLOY_SERVER_TARGET }}
|
||||
- name: Remove dist directory
|
||||
run: |
|
||||
rm -rf dist/
|
||||
docker images | grep -v REPOSITORY | awk '{print $3}' | xargs docker rmi --force
|
||||
integration2:
|
||||
name: Build PHP ${{ matrix.php-versions }} for ${{ matrix.arch }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: [ "7.2.34", "7.3.33", "7.4.27", "8.0.15", "8.1.4" ]
|
||||
arch: [ "aarch64", "armv7", "i386" ]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Change Dockerfile to ${{ matrix.arch }}
|
||||
run: cd docker/ && sed -ie 's/alpine:latest/multiarch\/alpine:${{ matrix.arch }}-edge/g' Dockerfile && docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
cd docker/
|
||||
if [[ "${{ matrix.arch }}" != "x86_64" ]]; then
|
||||
if [[ "${{ matrix.arch }}" = "armv7l" ]]; then
|
||||
sed -ie 's/alpine:latest/multiarch\/alpine:armv7-edge/g' Dockerfile
|
||||
else
|
||||
sed -ie 's/alpine:latest/multiarch\/alpine:${{ matrix.arch }}-edge/g' Dockerfile
|
||||
fi
|
||||
docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
fi
|
||||
- name: Build PHP ${{ matrix.php-versions }}
|
||||
run: cd docker/ && docker build . --file Dockerfile --tag static-php --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=${{ matrix.php-versions }}
|
||||
- name: Push PHP ${{ matrix.php-versions }} to dist
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user