Bugfixing portainer API call
Some checks failed
Docker Build, Push, and Deploy to Portainer / Build and Push Docker Image (push) Successful in 1m44s
Docker Build, Push, and Deploy to Portainer / Deploy Application to Portainer (push) Failing after 3s

This commit is contained in:
2025-05-30 14:10:57 -04:00
parent 4a58715f34
commit 2b4b83c87d

View File

@ -12,7 +12,7 @@ env:
jobs: jobs:
build-and-push: build-and-push:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Build and Push Docker Image
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -60,7 +60,7 @@ jobs:
CURL_OPTS: "-s" # Silent mode CURL_OPTS: "-s" # Silent mode
steps: steps:
- name: Deploy Container to Portainer - name: Deploy Container to Portainer via API
run: | run: |
set -e # Exit immediately if a command exits with a non-zero status. set -e # Exit immediately if a command exits with a non-zero status.
echo "Starting deployment of image ${{ env.IMAGE_TO_DEPLOY }} as container ${{ env.CONTAINER_NAME }}" echo "Starting deployment of image ${{ env.IMAGE_TO_DEPLOY }} as container ${{ env.CONTAINER_NAME }}"
@ -95,6 +95,9 @@ jobs:
CREATE_PAYLOAD=$(cat <<EOF CREATE_PAYLOAD=$(cat <<EOF
{ {
"Image": "${{ env.IMAGE_TO_DEPLOY }}", "Image": "${{ env.IMAGE_TO_DEPLOY }}",
"ExposedPorts": {
"${{ env.CONTAINER_PORT }}/tcp": {}
},
"HostConfig": { "HostConfig": {
"PortBindings": { "PortBindings": {
"${{ env.CONTAINER_PORT }}/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "${{ env.HOST_PORT }}" } ] "${{ env.CONTAINER_PORT }}/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "${{ env.HOST_PORT }}" } ]