actions / runner-container-hooks

Runner Container Hooks for GitHub Actions
MIT License
73 stars 44 forks source link

Permission denied while cd to my server directory #153

Closed nazib closed 6 months ago

nazib commented 6 months ago

I am getting permission denied error again and again with my deploy.yml. The droplet server is running a flask app. The problem start with the line

cd /root/mywebsite/

Tried with sudo cd /root/mywebsite/ but no change

The full deployment file is here:

on:
  push:
    branches: [ "main" ]
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
            python-version: '3.11' 

      - name: Install SSH key
        uses: webfactory/ssh-agent@v0.5.1
        with:
          ssh-private-key: ${{ secrets.SSH_PRIVATEKEY }}

      - name: Print ssh-add identities
        run: ssh-add -l

      - name: Install dependencies and run the app
        run: | 
          cd /root/mywebsite
          sudo git pull origin main
          sudo pip install -r requirements.txt
          sudo gunicorn --workers 2 app:app
nikola-jokic commented 6 months ago

Hey @nazib,

This issue is not related to container hooks. I don't believe this is a runner issue also, I think you need to modify your workflow file.