Giter Site home page Giter Site logo

jacksoncool / cloudways-api-git-pull-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from roelmagdaleno/cloudways-api-git-pull-action

0.0 0.0 0.0 25 KB

This GitHub Action will deploy your last project changes from GitHub to your Cloudways server.

JavaScript 100.00%

cloudways-api-git-pull-action's Introduction

Cloudways API Git Pull Action

Cloudways allows you to deploy your WordPress project (plugin, theme or entire site) from Git using the Cloudways API.

This GitHub Action will deploy your last project changes from GitHub to your Cloudways server.

Configuration

To use this GitHub Action you need:

  1. Cloudways account.
  2. Cloudways API Key.
  3. Deployment Via Git already configured.
  4. Cloudways' data stored in your GitHub repository secrets.

Cloudways provides you an easy way to get it in its own platform or read this guide about how to generate it.

Also, you can read this guide to know how to set up your Deployment Via Git functionality in Cloudways.

Secrets

You can specify the Cloudways' data right into your Workflow file but that is not recommended for security reasons.

Instead, you must use GitHub Secrets for your repository with the following names:

  • CLOUDWAYS_EMAIL
  • CLOUDWAYS_API_KEY
  • CLOUDWAYS_SERVER_ID
  • CLOUDWAYS_APP_ID
  • CLOUDWAYS_BRANCH_NAME
  • CLOUDWAYS_DEPLOY_PATH

Follow the exact secrets names in your Workflow file, so you can identify those quickly.

GitHub Secrets are set in your repository settings.

Required Inputs

You must provide all of these inputs in your Workflow file.

  • email
  • api-key
  • server-id
  • app-id
  • branch-name
  • deploy-path

Usage

To get started, you might want to copy the content of the next example into .github/workflows/cloudways-deploy.yml and push that file to your repository.

In the example, the deployment will start when you create and push a new tag. You can change that behavior, for example, when you create a release or a simple push to your main branch.

name: Cloudways API Git Pull

on:
  push:
    tags:
      - "*"

jobs:
  tag:
    name: New Tag

    runs-on: ubuntu-latest

    steps:
      - name: Checkout Code
        uses: actions/checkout@v2

      - name: Cloudways API Git Pull
        uses: roelmagdaleno/cloudways-api-git-pull-action@stable
        with:
          email: ${{ secrets.CLOUDWAYS_EMAIL }}
          api-key: ${{ secrets.CLOUDWAYS_API_KEY }}
          server-id: ${{ secrets.CLOUDWAYS_SERVER_ID }}
          app-id: ${{ secrets.CLOUDWAYS_APP_ID }}
          branch-name: ${{ secrets.CLOUDWAYS_BRANCH_NAME }}
          deploy-path: ${{ secrets.CLOUDWAYS_DEPLOY_PATH }}

If you don't see your last changes in your server after run the GitHub Action then check whether your Git branch is updated with the changes.

deploy-path

The deploy-path input is the path your deployment will paste the project last changes.

If you want to deploy inside the public_html then its value must be an empty string.

If you want to deploy, for example, to a plugin folder then the deploy-path value must be:

deploy-path: 'wp-content/plugins/<plugin-name>/'

As you can see, we don't need to specify the public_html string to the path.

It's important to finish the path with a slash.

License

This GitHub Action is available for use and remix under the MIT license.

cloudways-api-git-pull-action's People

Contributors

roelmagdaleno avatar

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.