Closed bitforcesrl closed 15 hours ago
@bitforcesrl 👋🏻 can you confirm which version of cli-hydrogen
you're trying to use? The deploy
command was marked as stable in v7.
@graygilmore we are executing the following command via GitHub Actions:
npx shopify hydrogen deploy --build-command "yarn build"
The GitHub Actions we are using are those generated automatically by Oxygen
# Don't change the line below!
#! oxygen_storefront_id: xxxx
name: Storefront xxxx
on:
- push
permissions:
contents: read
deployments: write
jobs:
deploy:
name: Deploy to Oxygen
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
check-latest: true
- name: Get yarn cache directory
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: "${{ steps.yarn-cache-dir-path.outputs.dir }}"
key: "${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}"
restore-keys: "${{ runner.os }}-yarn-\n"
- name: Install dependencies
id: install-dependencies
run: yarn
- name: Build and Publish to Oxygen
id: deploy
run: npx shopify hydrogen deploy --build-command "yarn build"
env:
SHOPIFY_HYDROGEN_DEPLOYMENT_TOKEN: "${{ secrets.OXYGEN_DEPLOYMENT_TOKEN_688471 }}"
Thanks! Unfortunately that doesn't say what version of cli-hydrogen
you are running. What does your package.json
say for that dependency? And what is committed as the version to your lockfile?
We are using cli-hydrogen v4.0.3
.
I've updated the dependency to the latest version (v8) but now we have another problem, we need to update remix to v2 because the cli requires it.
Is there a guide to migrate our code base from remix 1 to remix 2?
Thank you
Hey @bitforcesrl, please follow this and turn on all the v2 future flags in your project https://github.com/Shopify/hydrogen/discussions/739
Since your project is quite behind, I wonder if it is better to just regenerate a new project and copy your existing project into the new project. Your project is most likely require a very strict dependency between all the Remix, Shopify package versions and if you bump any package's versions, the project might not even run. Since Hydrogen v2023.10.0, Remix becomes a peer dependency along with many other Remix and Shopify packages ... and trying to carefully upgrade your project through all of these changes would be challenging.
We introduced a h2 upgrade
in 2023.10.0
cli command that should work retroactively if you can get your project to Hydrogen 2023.1.0
. Maybe give this a try? but only run this command after you have turn on all v2 future flags.
Also check out Remix's guide here: https://remix.run/docs/en/main/start/v2
Thanks for the advice. The project it's quite big. It's deployed in a capacitor app on android and apple stores and it runs code to control a robot machine via bluetooth that makes ice cream. Plus in the app there are pages that show products that are on the shopify e-commerce. Migrating it to a new project structure will be challenging too. when the current git hub actions will be deprecated? https://www.tooa.com/en/products/macchina-gelato-bupt0000
when the current git hub actions will be deprecated?
No immediate plans to remove the action but important to note that it won't be receiving any new features. For example, end-to-end testing with authentication bypass tokens is only available through the updated cli-hydrogen
package.
Closing as this isn't a bug with the deploy
command.
Please confirm that you have:
In which of these areas are you experiencing a problem?
Hydrogen custom storefront
Expected behavior
The actions should succeed
Actual behavior
After merging the pull request created from the shopify bot the github action step "Build and Publish to Oxygen" fails.
Verbose output
Reproduction steps
Run the github actions to deploy on oxygen
Operating System
github action
Shopify CLI version (check your project's
package.json
if you're not sure)latest
Shell
No response
Node version (run
node -v
if you're not sure)v20
What language and version are you using in your application?
No response