linchpin / action-wpengine-deploy

Github Action for deploying code to WP Engine
0 stars 1 forks source link

Error on `cd build` on line 50 in deploy.sh #1

Open gardinermichael opened 3 years ago

gardinermichael commented 3 years ago

Hi there,

First off, thank you for this action -- I'm attempting to deploy to WPEngine and it's been a godsend.

To start things off, here is my yml file:

# Basic workflow that is manually triggered

name: Manual workflow

jobs:
  build:

    runs-on: ubuntu-latest

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

    - name: Install Yarn Dependecies
      run: yarn
      working-directory: ./clone

    - name: Install PHP Dependencies
      run: composer install --no-ansi --no-dev --no-interaction --optimize-autoloader --no-progress
      working-directory: ./clone

    - name: Build compiled files
      run: |
        yarn build
        yarn build:production
      working-directory: ./clone

    - name: Deploy to WP Engine
      id: wpengine_deploy
      uses: linchpin/action-wpengine-deploy@master
      env:
        PROJECT_TYPE: ${{ secrets.PROJECT_TYPE }}
        REPO_NAME: ${{ secrets.REPO_NAME }}
        WPE_SSH_KEY_PRIVATE: ${{ secrets.WPE_SSH_KEY_PRIVATE }}
        WPE_SSH_KEY_PUBLIC: ${{ secrets.WPE_SSH_KEY_PUBLIC }}
        WPE_INSTALL: ${{ secrets.WPE_INSTALL }}

And here is the error that I'm getting:

Screen Shot 2020-11-11 at 2 06 26 PM

I'm wondering why this line (50) in deploy.sh is included:

cd build

I'm building the files in the theme's root directory and don't have a build folder, so that part is obvious, but I'm a bit confused as to the codeship reference in the comments above the line. I'm also not sure how to use said build folder as it was my impression that we're working in the ./clone folder.

I guess I was hoping for a little bit of clarification since I'm not sure exactly what's happening but I will fork your repo and tinker around a little bit.

aaronware commented 3 years ago

Hey @gardinermichael as you said this might actually be an artifact from our old CI/CD tool CodeShip. We actually don't utilize this action anymore and have migrated our internal deployments to rsync https://github.com/linchpin/rsync-deploy along with a bunch of other supporting actions https://github.com/linchpin?q=action

aaronware commented 3 years ago

If you do resolve it please provide a pull request and I'll merge it in after a review. More than likely you can get rid of the cd build if the directory structure isn't the same in the action. This was working previously as we do have some projects using it but maybe things changed after actions were out of beta.

gardinermichael commented 3 years ago

Well the good news I got it to work by changing the build to clone! I'm not sure if the fix is only for my setup, although I have a pretty basic one.

However, I'm wondering how necessary it is to boot up a docker container for what I can tell is mostly just ssh and git. Would you happen to know if it's possible to do those commands within the github action workflow outright, instead of loading up a docker container for them? I only ask as the files are built within the github action container. Or are they the same container and I'm just hopelessly confused?

aaronware commented 3 years ago

I think all actions are containerized? And I think that is the case any time you have individual actions (vs tasks). I think it will make containers and then if you wanted to pass data you would make artifacts. But in theory it is just a bunch of ssh commands