Skip to content

Added a reusable workflow to deploy a portainer stack #1

Added a reusable workflow to deploy a portainer stack

Added a reusable workflow to deploy a portainer stack #1

Workflow file for this run

name: deploy a stack on portainer

Check failure on line 1 in .github/workflows/deploy-stack.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/deploy-stack.yml

Invalid workflow file

(Line: 8, Col: 9): Unexpected value 'type'
on:
workflow_call:
secrets:
portainer_stack_webhook:
required: true
type: string
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Connect to vpn (necessary to access portainer)
run: |
sudo apt install resolvconf
sudo apt install wireguard
echo "${{ secrets.WIREGUARD_CONF }}" > wg0.conf
sudo chmod 600 wg0.conf
echo "setting config"
sudo wg-quick up ./wg0.conf
- name: Trigger Portainer stack webhook
run: |
response=$(curl -X POST -w "%{http_code}" -o /dev/null -s ${{ secrets.portainer_stack_webhook }})
if [ "$response" -ne 204 ]; then
echo "Error: POST request failed with status code $response"
exit 1
fi