Skip to content

Updated demo store with usage of the latest hydrogen #154

Updated demo store with usage of the latest hydrogen

Updated demo store with usage of the latest hydrogen #154

# Don't change the line below!
#! oxygen_storefront_id: 1343547
name: Storefront 1343547
on: [push]
permissions:
contents: read
deployments: write
jobs:
deploy:
name: Deploy to Oxygen
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup node.js
uses: actions/setup-node@v4
with:
node-version: '18'
check-latest: true
- name: Cache node modules
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
id: 'install-dependencies'
run: npm ci
- name: Set deployment environment
id: set-env
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "env=production" >> $GITHUB_ENV
else
echo "env=preview" >> $GITHUB_ENV
fi
- name: Build and Publish to Oxygen
run: npx shopify hydrogen deploy
env:
SHOPIFY_HYDROGEN_DEPLOYMENT_TOKEN: ${{ secrets.OXYGEN_DEPLOYMENT_TOKEN_1343547 }}
#build_command: "HYDROGEN_ASSET_BASE_URL=$OXYGEN_ASSET_BASE_URL npm run build"
# Create GitHub Deployment
- 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 }}