portainer-deploy
This action deploy image by portainer
Inputs
serverurl
required portainer server url. like this: http://xxx.com:9000
portainer服务器公网地址 需要公网能够访问
username
required portainer username
portainer 面板登录所用的用户名
password
required portainer password
portainer 面板登录所用的密码
endpointId
portainer endpoint id,default 1, localhost is 1
portainer终结点id,默认是1,即第一个,一般为localhost
stackname
required name of stack
服务栈的名称,会在stacks列表里显示
registry
address of registry, like: myregistry.example.com (leave empty for Docker Hub)
imagename
required name of pull image, like: mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine
将会进行拉取镜像的镜像名
docker_compose
content of docker-compose.yml. ps: portainer just support version: "2"
docker-compose.yml的内容 注意:portainer目前仅支持version: "2"
like this:
docker_compose: |
version: "2"
services:
dotnet_test:
image: mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine
container_name: dotnet_runtime
leave empty for use the current docker-compose file content
Example usage
The following will pull image mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine, and deploy docker-compose to portainer.
- name: deploy to portainer
uses: LGinC/portainer-stack-deploy@master
with:
serverurl: http://xxx.com:9000
username: ${{ secrets.PORTAINER_USERNAME }}
password: ${{ secrets.PORTAINER_PASSWORD }}
endpointId: 1
stackname: dotnet_test
registry: mcr.microsoft.com
imagename: dotnet/core/aspnet:3.1-alpine
docker_compose: |
version: "2"
services:
dotnet_test:
image: mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine
container_name: dotnet_runtime