Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from oxygenctl-action to Hydrogen CLI #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shopify[bot]
Copy link

@shopify shopify bot commented Mar 26, 2024

Introducing the deploy command

The shopify/oxygenctl-action is being deprecated and all merchants are encouraged to migrate to the Hydrogen CLI deploy command

Important

To use the deploy command, upgrade your Hydrogen project to use Hydrogen CLI v7.0.0 or later: npm install @shopify/cli-hydrogen@latest.

Understanding the code changes

This pull request will try to automate the migration for you but you might need to make manual changes. There are two important changes:

  1. Migrate from shopify/oxygenctl-action to use npx shopify hydrogen deploy
  2. Remove shopify/github-deployment-action

Tip

Try viewing the file changes with white space disabled, since there may be unrelated formatting changes.

Manual changes

If you've heavily modified your workflow file(s) and the diff generated by this pull request is too large, you can implement these changes yourself. Here are some simplified examples of the required updates:

Migrate from shopify/oxygenctl-action to npx shopify hydrogen deploy

  - name: Build and Publish to Oxygen
    id: deploy
-   uses: shopify/oxygenctl-action@v4
+   run: npx shopify hydrogen deploy
+   env:
+     SHOPIFY_HYDROGEN_DEPLOYMENT_TOKEN: ${{ secrets.OXYGEN_DEPLOYMENT_TOKEN_X }}
-   with:
-     oxygen_deployment_token: ${{ secrets.OXYGEN_DEPLOYMENT_TOKEN_X }}
-     build_command: "npm run build"

Remove shopify/github-deployment-action

- - name: Create GitHub Deployment
-   uses: shopify/github-deployment-action@v1
-   if: always()
-     with:
-       token: ${{ github.token }}
-       environment: 'preview'
-       preview_url: ${{ steps.deploy.outputs.url }}
-       description: ${{ github.event.head_commit.message }}

Troubleshooting

Command `hydrogen deploy` not found.error

The deploy command was publicly released with @shopify/cli-hydrogen v7.0.0. You'll need to update to v7.0.0 or later in order to use deploy. Learn more about the release in the changelog.

Nonexistent flag error

The --build-command and --no-verify flags were released with @shopify/cli-hydrogen v7.1.0. If your workflow file includes those flags, you'll need to update to v7.1.0 or later to use them. Learn more about the release in the changelog.

@github-actions github-actions bot had a problem deploying to preview March 26, 2024 20:22 Failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants