I need to build some files in one branch and, push the newly formed and updated files to another branch of the same repo using github actions. I have tried this way but
it always fails at commit to staging branch
name: Deployment
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build files and folders
run: |
./build.sh
rm -rf cache
mkdir logs
cd logs
ls>output.txt
- name: commit to staging
run: |
git checkout staging
git add *
git commit -m "new push to staging"
git push
Error
/home/runner/work/_temp/c305681-ab7e-42f8-b39c-8ef35264cff.sh: line 1: github: command not found
Error: Process completed with exit code 127
mkdir logs && cd logs && ls>output.txt
— I expectoutput.txt
to be empty because you runls
in an empty (freshly created) directory.Also side note: mkdir logs && cd logs && ls>output.txt
thank you for pointing out that mistake. Anyways I have updated the post with error