42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
name: Release
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
env:
|
|
PHP_VERSION: '8.3' # set this to the PHP version to use
|
|
COMPOSER_ALLOW_SUPERUSER: 1
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
switch-production:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@7c0b4c8c8ebed23eca9ec2802474895d105b11bc
|
|
with:
|
|
php-version: ${{ env.PHP_VERSION }}
|
|
- name: Check if composer.json exists
|
|
id: check_files
|
|
uses: andstor/file-existence-action@87d74d4732ddb824259d80c8a508c0124bf1c673
|
|
with:
|
|
files: 'composer.json'
|
|
- name: Run composer install if composer.json exists
|
|
if: steps.check_files.outputs.files_exists == 'true'
|
|
run: |
|
|
composer validate --no-check-publish && composer install --prefer-dist --no-progress --ignore-platform-reqs
|
|
- name: Install ssh agent, rsync
|
|
run: |
|
|
apt update
|
|
apt install -y openssh-client rsync
|
|
- name: Switch to release
|
|
uses: deployphp/action@v1
|
|
with:
|
|
deployer-binary: "./bin/dep"
|
|
dep: --file=./build/deploy.php release:switch production
|
|
private-key: ${{secrets.PROD_KEY}}
|