All Projects → atymic → deployer-php-action

atymic / deployer-php-action

Licence: MIT license
Deploy PHP projects using Deployer from Github Actions

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to deployer-php-action

Github Pages Deploy Action
Automatically deploy your project to GitHub Pages using GitHub Actions. This action can be configured to push your production-ready code into any branch you'd like.
Stars: ✭ 2,507 (+4298.25%)
Mutual labels:  deployment, deployer, cicd
action-homebrew-bump-formula
⚙️ A GitHub Action to easily bump Homebrew formula on new release
Stars: ✭ 68 (+19.3%)
Mutual labels:  actions, action
actions
Our Library of GitHub Actions
Stars: ✭ 49 (-14.04%)
Mutual labels:  actions, cicd
github-action-wpe-site-deploy
A GitHub Action to deploy code directly to WP Engine.
Stars: ✭ 116 (+103.51%)
Mutual labels:  deployment, actions
gh-actions-html-table-generator
Read from a json file and write to the README
Stars: ✭ 29 (-49.12%)
Mutual labels:  actions, action
release-changelog-builder-action
A GitHub action that builds your release notes / changelog fast, easy and exactly the way you want.
Stars: ✭ 515 (+803.51%)
Mutual labels:  actions, action
redux-reducer-async
Create redux reducers for async behaviors of multiple actions.
Stars: ✭ 14 (-75.44%)
Mutual labels:  actions, action
setup-jdk
(DEPRECATED) Set up your GitHub Actions workflow with a specific version of AdoptOpenJDK
Stars: ✭ 32 (-43.86%)
Mutual labels:  actions, action
dart-package-publisher
Action to Publish Dart / Flutter Package To https://pub.dev When you need to publish a package, just bump the version in pubspec.yaml
Stars: ✭ 45 (-21.05%)
Mutual labels:  actions, action
chrome-extension-upload
upload & publish extensions to the Chrome Web Store.
Stars: ✭ 35 (-38.6%)
Mutual labels:  actions, action
setup-lazarus
Set up your GitHub Actions workflow with a specific version of Lazarus
Stars: ✭ 29 (-49.12%)
Mutual labels:  actions, action
porter
Multi-region blue-green Docker deployments and a whole lot more
Stars: ✭ 43 (-24.56%)
Mutual labels:  deployment, zero-downtime
pr-compliance-action
Check PR for compliance on title, linked issues, and files changed
Stars: ✭ 151 (+164.91%)
Mutual labels:  actions, action
action-dynamic-readme
~ Dynamic ReadME Generator ~
Stars: ✭ 29 (-49.12%)
Mutual labels:  actions, action
Deploy
Ansible role to deploy scripting applications like PHP, Python, Ruby, etc. in a capistrano style
Stars: ✭ 2,141 (+3656.14%)
Mutual labels:  deployment, deployer
deployer-extended-wordpress
Deployer based deployment for WordPress with media and database synchronisation.
Stars: ✭ 24 (-57.89%)
Mutual labels:  deployment, deployer
St2
StackStorm (aka "IFTTT for Ops") is event-driven automation for auto-remediation, security responses, troubleshooting, deployments, and more. Includes rules engine, workflow, 160 integration packs with 6000+ actions (see https://exchange.stackstorm.org) and ChatOps. Installer at https://docs.stackstorm.com/install/index.html. Questions? https://…
Stars: ✭ 4,600 (+7970.18%)
Mutual labels:  deployment, cicd
Rsync Deployments
GitHub Action for deploying code via rsync over ssh
Stars: ✭ 59 (+3.51%)
Mutual labels:  deployment, action
actions
Set of actions for implementing CI/CD with werf and GitHub Actions
Stars: ✭ 67 (+17.54%)
Mutual labels:  actions, action
setup-hashlink
A github action to install and setup Hashlink
Stars: ✭ 13 (-77.19%)
Mutual labels:  actions, action

deployer-php GitHub Action

Deployer is an open source zero downtime deployment tool for PHP.

This action makes it easy to deploy your php services using Github Actions by setting up everything for you.

What the action does

  • Starts the ssh-agent
  • Loads your deployment SSH private key into the agent
  • Configures known_hosts with your provided key (or turns of SSH host key checking)
  • Installs deployer

Using the action

For a complete guide on setting Zero Downtime Deployment with Laravel, see: atymic.dev/blog/github-actions-laravel-ci-cd/.

  1. Create an SSH private key for your deploy user. It's a good idea to generate a new key specifically for deployment (ideally on a specific deployment user with minimal permissions).

  2. In your repository, go to the Settings > Secrets menu and create a new secret called SSH_PRIVATE_KEY. Put the unencrypted private SSH key into the contents field.
    This key should start with -----BEGIN RSA PRIVATE KEY-----, consist of many lines and ends with -----END RSA PRIVATE KEY-----. You can just copy the key as-is from the private key file.
    Note: This actions supports both standard keys & pem keys (the action will fix the formatting before loading them into the agent).

  3. Add another Secret called SSH_KNOWN_HOSTS, and paste the key fingerprint(s) of your server. You can find these using the following command ssh-keyscan rsa -t <server IP>.
    Disabling Host Check Checking (Not Recommended):
    You can disable strict host key checking by passing ssh-disable-host-key-checking: true to the action.

  4. In your workflow definition file, add the following step. This should be after setting up php & installing composer dependencies.

# .github/workflows/workflow.yml
jobs:
    deployment_job:
        ...
        steps:
            - actions/checkout@v1
            - uses: shivammathur/setup-php@master
                with:
                  php-version: 7.3
            - run: composer install
            # Make sure the @0.3.1 matches the current version of the action
            # You can also use `master`, but it's best to lock to a specific version
            - uses: atymic/[email protected]
              with:
                  ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
                  ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
                  # To disable host key checking (insecure!):
                  ssh-disable-host-key-checking: true
            - ... other steps

Known issues and limitations

Works for the current job only

Since each job runs in a fresh instance of the virtual environment, the SSH key will only be available in the job where this action has been referenced. You can, of course, add the action in multiple jobs or even workflows. All instances can use the same SSH_PRIVATE_KEY secret.

Creating SSH keys

In order to create a new SSH key, run ssh-keygen -t rsa -b 4096 -m pem -f path/to/keyfile. This will prompt you for a key passphrase and save the key in path/to/keyfile.

Having a passphrase is a good thing, since it will keep the key encrypted on your disk. When configuring the secret SSH_PRIVATE_KEY value in your repository, however, you will need the private key unencrypted.

Contributing

Javascript Actions Documentation: https://help.github.com/en/articles/creating-a-javascript-action

  • Fork/Clone the repo.
  • Run yarn install to fetch dependencies
  • Make changes
  • Update the README with any changes (if required)
  • Create a PR without building the code (it's too hard to review the compiled code. I'll compile it before releasing)

Credits

Copyright 2019 atymic. Code released under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].