Skip to content

Deploy PRODUCTION instance #136

Deploy PRODUCTION instance

Deploy PRODUCTION instance #136

Workflow file for this run

on:
workflow_dispatch:
inputs:
check_config:
type: boolean
description: 'Fail when configuration overridden'
required: true
default: true
sql_backup:
type: boolean
description: 'Create SQL backup'
required: true
default: true
name: 'Deploy production instance'
jobs:
deploy:
name: 'deployment'
runs-on: self-hosted
steps:
- name: 'Checkout source code'
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: 'Install dependencies'
uses: eaudeweb/[email protected]
with:
dev: false
php: /usr/bin/php81
- name: 'Create release archive'
id: artifact
uses: eaudeweb/[email protected]
- name: 'Deploy release on the server'
uses: eaudeweb/[email protected]
with:
ssh_user: ${{ secrets.PROD_SSH_USER }}
ssh_host: ${{ secrets.PROD_SSH_HOST }}
ssh_key: ${{ secrets.PROD_SSH_KEY }}
release_id: 'release-${{ github.ref_name }}'
release_filename: ${{ steps.artifact.outputs.filename }}
project_dir: /var/www/html/eu-parc.eu
artifacts_dir: /var/www/artifacts/eu-parc.eu
settings_file: /var/www/config/eu-parc.eu/settings.local.php
public_files_dir: /var/www/config/eu-parc.eu/files
robo_file: /var/www/config/eu-parc.eu/robo.yml
database_dump_dir: /var/www/config/eu-parc.eu/sync
artifacts_lifespan: 30
check_config: ${{ inputs.check_config }}
sql_backup: ${{ inputs.sql_backup }}
- name: 'Update the Drupal instance'
id: release
uses: eaudeweb/[email protected]
with:
path: /var/www/html/eu-parc.eu
- name: 'Discord notification'
run: >
curl -X POST -F "content=:white_check_mark: **${{ github.repository }}** release **${{ github.ref_name }}** has been deployed on PROD: <https://eu-parc.eu>." ${{ secrets.DISCORD_WEBHOOK }}
- name: 'Discord notification on failed deploy'
if: failure()
run: >
curl -X POST -F
"content=:octagonal_sign: **${{ github.repository }}** failed to deploy release **${{ github.ref_name }}** on PROD: <https://eu-parc.eu>.
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
${{ secrets.DISCORD_WEBHOOK }}