Skip to content

Production-rollback #20

Production-rollback

Production-rollback #20

name: Production-rollback
on: workflow_dispatch
concurrency: production_environment
jobs:
rollback:
runs-on: ubuntu-latest
environment: production
defaults:
run:
working-directory: ./src
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- name: Install composer dependencies
run: composer install --optimize-autoloader --no-dev --quiet
- name: Rollback
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }}
DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }}
run: |
mkdir -p ~/.ssh
touch ~/.ssh/deploy
(echo ${{ secrets.DEPLOY_SSH_KEY }} | base64 --decode -i > ~/.ssh/deploy)
chmod 700 ~/.ssh/deploy
php ./vendor/bin/dep rollback
- name: Send success status
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: Rollback - done ↩️