What I'm trying to achieve:
A fully automated deployment for a React App, on any commit to the live
branch, by my own defined Github Runner, which is running Ubuntu Server 20.04
, with npm 6.14.8
What I have so far:
autodeploy.yml
name: AutoDeploy
on:
push:
branches: [live]
jobs:
build:
name: Deploy Client App
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12'
- name: Fetch latest version
uses: actions/checkout@v1
- name: Install Dependencies
run: npm install
working-directory: ./Code/client-app-react
- name: Build project
run: npm run build
working-directory: ./Code/client-app-react
- name: Copy build to webserver
run: sudo cp -r ./ /var/www/domains/react.app.public
working-directory: ./Code/client-app-react/build
- name: Copy .htaccess to webserver
run: sudo cp .htaccess /var/www/domains/react.app.public/.htaccess
working-directory: ./Media/Server
Everything seems to work until I get to the Copy/Paste step by
sudo cp -r ./ /var/www/domains/react.app.public
The message I get is:
sudo: no tty present and no askpass program specified
Error: Process completed with exit code 1.
I have no clue of what AskPass is or how to open a TTY. I expected this to work according to this article:
https://stackoverflow.com/questions/57830375/github-actions-workflow-error-permission-denied
How do I execute privileged or elevated commands from the Github Action configuration file autodeploy.yml
?