Code Monkey home page Code Monkey logo

pantheon-deploy's Introduction

Note: Experimental unofficial tool, use at your own risk

Using GitHub Actions is a great option for deploying code from a GitHub repository to Pantheon if you want to add additional Continous Integration workflow in your setup.

With this Github action, you can:

  • Deploy you repo with
    • Whole code repo
    • To a nested docroot /web path (TODO)
    • A specific theme, plugin, or any other directory by specifying the LOCAL_PATH and REMOTE_PATH options. (TODO)
  • Post deploy options:
    • Clear cache (TODO)
    • Auto commit and deploy to TEST envionment (TODO)
    • Auto commit and deploy to LIVE envionment (TODO)

Setup Instructions

  1. SSH PUBLIC KEY SETUP IN Pantheon
  1. Machine Tokens in Pantheon
  1. Secret token SETUP IN GITHUB
  1. YML SETUP
  • Create .github/workflows/pantheon-deploy.yml directory and file locally. Copy and paste the configuration from the samples below replacing values accordingly.
  1. Git push your site GitHub repo. The action will do the rest!

View your actions progress and logs by navigating to the "Actions" tab in your repo.

Example GitHub Action workflow

Sample Github action that you can add in your repo

minimal options

name: Pantheon Build
on:
  push:
    branches:
      - main

jobs:
  github_deploy:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Pantheon Deploy
      uses: pantheoncarl/pantheon-deploy@main
      id: cache-vendor
      env:
        PANTHEONSITEUUID: 1234abcd-1234-abc-1111-1234abcd
        PANTHEON_TERMINUS_MACHINE_TOKEN: ${{ secrets.PANTHEON_TERMINUS_MACHINE_TOKEN }}
        PANTHEON_PRIVATE_KEY: ${{ secrets.PANTHEON_PRIVATE_KEY }}

all options options

name: Pantheon Build
on:
  push:
    branches:
      - main

jobs:
  github_deploy:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Pantheon Deploy
      uses: pantheoncarl/pantheon-deploy@main
      id: cache-vendor
      env:
        PANTHEONSITEUUID: 1234abcd-1234-abc-1111-1234abcd
		PANTHEONENV: multidev1
        PANTHEON_TERMINUS_MACHINE_TOKEN: ${{ secrets.PANTHEON_TERMINUS_MACHINE_TOKEN }}
        PANTHEON_PRIVATE_KEY: ${{ secrets.PANTHEON_PRIVATE_KEY }}
		PANTHEONENV_AUTODEPLOY: live

Environment Variables & Secrets

Required

Name Type Usage
PANTHEON_PRIVATE_KEY secrets Private SSH Key.
PANTHEON_TERMINUS_MACHINE_TOKEN secrets Machine Token.
PANTHEONSITEUUID string Unique ID of the site that you will deploy to.

Deploy Options

Name Type Usage
PANTHEONENV string Environment that your code will be deployed to, cannot beon test and live because it is write only. dev(default) and multidevs only.
PANTHEONENV_AUTODEPLOY string Can be set to auto deploy in test or live. if not set, it will default to the environment set in PANTHEONENV
SRC_PATH string Optional path to specify a directory within the repo to deploy from. Ex. "wp-content/plugins/custom-plugin/". Defaults to root of repo filesystem as source.
REMOTE_PATH string Optional path to specify a directory destination to deploy to. Ex. "wp-content/plugins/custom-plugin/" . Defaults to WordPress root
CACHE_CLEAR bool Optionally clear page and CDN cache post deploy. This takes a few seconds. Default is FALSE.

pantheon-deploy's People

Contributors

carl-alberto avatar

Stargazers

 avatar

Watchers

 avatar  avatar Sean E Dozeman avatar

Forkers

sdozeuwb

pantheon-deploy's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.