3

I'm trying to deploy my rails app using Capistrano during a GitHub workflow. I know the workflow can run script bash, but it throws an error in a subsequent run command that uses chown.

Error:

chown: cannot access /var/www/html/xxxx/xxxx/: No such file or directory

My question is why I get such error, I'm sure that the path is correct though

my workflow file

# This is a basic workflow to help you get started with Actions
name: Deploy with Capistrano

# Controls when the action will run. 
on:
  # Triggers the workflow on push or pull request events but only for the main branch
  push:
    branches: [main]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  deploy:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
    # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
    - uses: actions/checkout@v2
    - uses: ruby/setup-ruby@v1
      with:
        # ruby-version: 3.0.1 # Not needed with a .ruby-version file
        bundler-cache: true # runs 'bundle install' and caches installed gems automatically
    - uses: miloserdow/capistrano-deploy@master
      with:
        target: production # Defines the environment that will be used for the deployment
        deploy_key: ${{ secrets.MONITOR }} # Name of the variable configured in Settings/Secrets of your github project
    - run: sudo chown -R $(user -u):$(group -g) "/var/www/html/xxxx/xxxx/"

1 Answers1

-1

I'm sure that the path is correct though

It does not cost much to double check:

- run: ls -alrth /var/www
- run: ls -alrth /var/www/html
- run: ls -alrth /var/www/html/xxxx
- run: ls -alrth /var/www/html/xxxx/xxxx

That way, you know if the checkout repository on which those GitHub actions are operating does indeed includes, after build, the files you think it should, in the folder you want.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250