mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
76 lines
3.8 KiB
YAML
76 lines
3.8 KiB
YAML
name: Docker Image CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Build PHP 7.2
|
|
run: cd docker/ && docker build . --file Dockerfile --tag static-php:7.2 --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=7.2.34
|
|
- name: Push PHP 7.2 to dist
|
|
run: |
|
|
mkdir dist && docker run --rm -v $(pwd)/dist:/dist/ static-php:7.2 cp php-dist/bin/php /dist/
|
|
mkdir dist/7.2 && mv dist/php dist/7.2/
|
|
- name: Build PHP 7.3
|
|
run: cd docker/ && docker build . --file Dockerfile --tag static-php:7.3 --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=7.3.30
|
|
- name: Push PHP 7.3 to dist
|
|
run: |
|
|
docker run --rm -v $(pwd)/dist:/dist/ static-php:7.3 cp php-dist/bin/php /dist/
|
|
mkdir dist/7.3 && mv dist/php dist/7.3/
|
|
- name: Build PHP 7.4
|
|
run: cd docker/ && docker build . --file Dockerfile --tag static-php:7.4 --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=7.4.23
|
|
- name: Push PHP 7.4 to dist
|
|
run: |
|
|
docker run --rm -v $(pwd)/dist:/dist/ static-php:7.4 cp php-dist/bin/php /dist/
|
|
mkdir dist/7.4 && mv dist/php dist/7.4/
|
|
- name: Build PHP 8.0
|
|
run: cd docker/ && docker build . --file Dockerfile --tag static-php:8.0 --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=8.0.10
|
|
- name: Push PHP 8.0 to dist
|
|
run: |
|
|
docker run --rm -v $(pwd)/dist:/dist/ static-php:8.0 cp php-dist/bin/php /dist/
|
|
mkdir dist/8.0 && mv dist/php dist/8.0/
|
|
- name: Change Dockerfile to aarch64
|
|
run: cd docker/ && sed -ie 's/alpine:latest/multiarch\/alpine:aarch64-edge/g' Dockerfile && docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
|
- name: Build PHP 7.2 arm
|
|
run: cd docker/ && docker build . --file Dockerfile --tag static-php:7.2 --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=7.2.34
|
|
- name: Push PHP 7.2 to dist
|
|
run: |
|
|
mkdir dist && docker run --rm -v $(pwd)/dist:/dist/ static-php:7.2 cp php-dist/bin/php /dist/
|
|
mkdir dist/7.2-aarch64 && mv dist/php dist/7.2-aarch64/
|
|
- name: Build PHP 7.3 arm
|
|
run: cd docker/ && docker build . --file Dockerfile --tag static-php:7.3 --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=7.3.30
|
|
- name: Push PHP 7.3 to dist
|
|
run: |
|
|
docker run --rm -v $(pwd)/dist:/dist/ static-php:7.3 cp php-dist/bin/php /dist/
|
|
mkdir dist/7.3-aarch64 && mv dist/php dist/7.3-aarch64/
|
|
- name: Build PHP 7.4 arm
|
|
run: cd docker/ && docker build . --file Dockerfile --tag static-php:7.4 --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=7.4.23
|
|
- name: Push PHP 7.4 to dist
|
|
run: |
|
|
docker run --rm -v $(pwd)/dist:/dist/ static-php:7.4 cp php-dist/bin/php /dist/
|
|
mkdir dist/7.4-aarch64 && mv dist/php dist/7.4-aarch64/
|
|
- name: Build PHP 8.0 arm
|
|
run: cd docker/ && docker build . --file Dockerfile --tag static-php:8.0 --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=8.0.10
|
|
- name: Push PHP 8.0 to dist
|
|
run: |
|
|
docker run --rm -v $(pwd)/dist:/dist/ static-php:8.0 cp php-dist/bin/php /dist/
|
|
mkdir dist/8.0-aarch64 && mv dist/php dist/8.0-aarch64/
|
|
- name: Deploy to Zhamao Server
|
|
uses: easingthemes/ssh-deploy@main
|
|
env:
|
|
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SERVER_SECRET_KEY }}
|
|
ARGS: "-rltgoDzvO --delete"
|
|
SOURCE: "dist/"
|
|
REMOTE_HOST: ${{ secrets.DEPLOY_SERVER_HOST }}
|
|
REMOTE_USER: ${{ secrets.DEPLOY_SERVER_USER }}
|
|
TARGET: ${{ secrets.DEPLOY_SERVER_TARGET }}
|