All things Shopify and commerce
Attempting to try to deploy hydrogen using Azure DevOps Pipelines. When I run the deploy command, both on the CI machine and my local machine, it attempts to login to Shopify.
The command I am running both on the CI and my local CLI...
npx shopify hydrogen deploy --token ************
The results of running the command...
To run this command, log in to Shopify.
According to the Deployment CI/CD Docs, it seems like this should be the only command that is needed. How can I deploy from a CI without logging into Shopify? Is it possible to do it with just the Oxygen deployment token?
Thanks!
Solved! Go to the solution
This is an accepted solution.
So we actually figured it out. Turns out the deploy command checks if your in a continuous integration (CI) environment (like GitHub Actions) and if your not, it falls back to user login. It does this by looking at environment variables (specifically the "CI" variable) and Azure DevOps Pipelines is not one of the supported CIs nor does it set the "CI" variable. Thus, the deploy command is unable to recognize in ADO, it's inside a CI.
To fix this simply set the "CI" environment variable to something truthy.
- script: |
npx shopify hydrogen deploy --token $(SHOPIFY_HYDROGEN_DEPLOYMENT_TOKEN)
displayName: Build and Publish to Oxygen
workingDirectory: click-and-collect-storefront
env:
CI: true
This is an accepted solution.
So we actually figured it out. Turns out the deploy command checks if your in a continuous integration (CI) environment (like GitHub Actions) and if your not, it falls back to user login. It does this by looking at environment variables (specifically the "CI" variable) and Azure DevOps Pipelines is not one of the supported CIs nor does it set the "CI" variable. Thus, the deploy command is unable to recognize in ADO, it's inside a CI.
To fix this simply set the "CI" environment variable to something truthy.
- script: |
npx shopify hydrogen deploy --token $(SHOPIFY_HYDROGEN_DEPLOYMENT_TOKEN)
displayName: Build and Publish to Oxygen
workingDirectory: click-and-collect-storefront
env:
CI: true
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025