运行位于公用文件夹github操作中的bash脚本



我在public/scripts文件夹中有这个脚本createmap.sh。我需要在主部署上运行它yaml文件中的代码是

name: create-map
on: push
run: .public/script.sh
runs-on: ubuntu-latest
shell: bash

这是一个简单的脚本,应该创建一个网站地图和ping谷歌

# yarn sitemap
$ cd public
$ rm -rf sitemap
$ mkdir sitemap
$ cd ..
$ cd scripts
$ node ./sitemap-posts.js
$ node ./compress-map.js
$ node ./create-one-map.js
$ curl http://google.com/ping?sitemap=https://website.com/sitemap.xml

我的文件夹结构是rootdirectory/scriptsrootdirectory/public

当我部署脚本时,脚本没有运行,我不知道的问题在哪里

您需要添加执行权限:

jobs:
run_tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Run script file
run: |
chmod +x ./public/scripts/test.sh
./public/scripts/test.sh
shell: bash

最新更新