Open isaiahdaviscom opened 1 year ago
This is how I achieved autodeploying to GAS :
Github workflow - deploy.yml
name: Deploy
on:
push:
branches: [ main ]
jobs:
deploy:
if: ${{ github.actor != 'dependabot' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node 16
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: 'npm'
- name: Install npm packages
run: npm install
- name: Create clasp.json
env:
SCRIPT_ID: ${{ secrets.SCRIPT_ID }}
run: echo '{"scriptId":"'$SCRIPT_ID'","rootDir":"dist"}' > .clasp.json
- name: Create folder structure
run: mkdir -p /home/runner
- name: Create clasprc.json
env:
CLASPRC: ${{ secrets.CLASPRC }}
run: echo "$CLASPRC" > /home/runner/.clasprc.json
- name: Deploy
run: npm run deploy
Scripts in package.json :
"scripts": {
"build": "webpack",
"upload": "npx clasp push -f",
"deploy": "npm run build && npm run upload",
}
With clasp has a dev dependency
@isaiahdaviscom maybe you fixed it by now, but there is a typo in your file name. I also encountered the same issue, the correct file name is appsscript.json
with a double s
as the error says.
I am passing
GitHub Secrets
as arguments for all the required fields of thisAction
.The
Action
runs on changes to themain
branch.The
main
branch structure has theAction
main.yml file under/.github/workflows
.When the main.yml file is executed the following error occurs at runtime:
ENOENT: no such file or directory, open '/appsscript.json'
The
/appscript.json
file is located at the root directory.I attempted to replace the
GitHub Secret
for the objectrootDir
to a string literal, but with no resolve.