[英]Invoke github workflow on serverless deploy
I have a serverless nodejs project with aws lambda that I am trying to deploy.我有一个我正在尝试部署的带有 aws lambda 的无服务器 nodejs 项目。 Before deploying i want to decrypt certain files and then trigger the actual deployment在部署之前,我想解密某些文件,然后触发实际部署
This is the content of my main.yml file inside .github/workflows directory这是我在.github/workflows目录中的main.yml文件的内容
name: Test
on: [deployment]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@test
- name: Decrypting files
run: <decrypt commands here>
- name: Actual Serverless Deployment
run: sls deploy -s staging
It is not getting invoked if i do sls deploy.如果我执行 sls deploy,它不会被调用。 I am intrigued how github will know that its a deployment event if i trigger sls deploy command.我很好奇如果我触发sls deploy命令,github 将如何知道这是一个部署事件。 Please help me in understanding when exactly the above deployment event will be triggered.请帮助我了解何时触发上述部署事件。 What I am trying to achieve is to start a deployment command(ie., sls deploy -s staging or the like) and that invokes the above workflow -> (action1)decrypts files -> (action2)triggers actual deployment to lambda.我想要实现的是启动部署命令(即sls deploy -s staging等)并调用上述工作流程->(action1)解密文件->(action2)触发实际部署到 lambda。
PS: The exact thing is working fine on git push, but i dont want it to deploy on every push to repo. PS:确切的事情在 git 推送上运行良好,但我不希望它在每次推送到回购时都部署。
Please help me in understanding this.请帮助我理解这一点。 I am very new to github workflows.我对 github 工作流程非常陌生。
The deployment
event occurs when a deployment is started, completed, etc. You can use Github Api to create a deployment: POST /repos/:owner/:repo/deployments
(further details here: https://developer.github.com/v3/repos/deployments/#create-a-deployment ) The deployment
event occurs when a deployment is started, completed, etc. You can use Github Api to create a deployment: POST /repos/:owner/:repo/deployments
(further details here: https://developer.github.com/ v3/repos/deployments/#create-a-deployment )
Alternatively, you can use或者,您可以使用
on:
push:
branches:
- master
to run your workflow only if something is merged to master.仅当某些内容合并到 master 时才运行您的工作流程。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.