diff --git a/.gitea/workflows/build-web.yml b/.gitea/workflows/build-web.yml index eefa693..712a420 100644 --- a/.gitea/workflows/build-web.yml +++ b/.gitea/workflows/build-web.yml @@ -63,7 +63,7 @@ jobs: - name: Redeploy stack in Portainer run: | # Read stack file content - STACK_FILE_CONTENT=$(echo "$( .env - docker buildx build --push -f Dockerfile -t $IMAGE_TAG . - - - name: Get the endpoint ID - # Usually ID is 1, but you can get it from the API. Only skip this if you are VERY sure. - run: | - ENDPOINT_ID=$(curl -s -H "X-API-Key: $PORTAINER_TOKEN" "$PORTAINER_API_URL/endpoints" | jq -r ".[] | select(.Name==\"$ENDPOINT_NAME\") | .Id") - echo "ENDPOINT_ID=$ENDPOINT_ID" >> $GITHUB_ENV - echo "Got stack Endpoint ID: $ENDPOINT_ID" - - - name: Fetch stack ID from Portainer - run: | - STACK_ID=$(curl -s -H "X-API-Key: $PORTAINER_TOKEN" "$PORTAINER_API_URL/stacks" | jq -r ".[] | select(.Name==\"$STACK_NAME\" and .EndpointId==$ENDPOINT_ID) | .Id") - - echo "STACK_ID=$STACK_ID" >> $GITHUB_ENV - echo "Got stack ID: $STACK_ID matched with Endpoint ID: $ENDPOINT_ID" - - - name: Fetch Stack - run: | - # Get the stack details (including env vars) - STACK_DETAILS=$(curl -s -H "X-API-Key: $PORTAINER_TOKEN" "$PORTAINER_API_URL/stacks/$STACK_ID") - - # Extract environment variables from the stack - echo "$STACK_DETAILS" | jq -r '.Env' > stack_env.json - - echo "Existing stack environment variables:" - cat stack_env.json - - - name: Redeploy stack in Portainer - run: | - # Read stack file content - STACK_FILE_CONTENT=$(echo "$(