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/"