This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
chore(release): v1.6.2 #828
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish & deploy canary version | |
env: | |
PWA_HOST: https://shopware-pwa-canary.storefrontcloud.io | |
CANARY_URL: https://shopware-pwa-canary.storefrontcloud.io | |
INSTANCE_CODE: shopware-pwa-canary | |
EXPERIMENTAL_IMAGE_PROCESSING_SERVER: https://test-shopware-pwa-images.vercel.app/api/image | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- "*.md" | |
- "docs/**" | |
jobs: | |
init: | |
name: Init dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "16" | |
- name: Cache node_modules | |
uses: actions/cache@v2 | |
id: step-cache-node-modules | |
env: | |
cache-name: cache-node-modules-test | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
- name: Install dependencies | |
if: steps.step-cache-node-modules.outputs.cache-hit != 'true' | |
run: | | |
yarn --frozen-lockfile | |
build-cli: | |
name: Build CLI | |
needs: init | |
runs-on: ubuntu-latest | |
outputs: | |
package-hash: ${{ steps.folder-hash-step-cli.outputs.hash }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "16" | |
- name: Check hash for directory packages/cli | |
id: folder-hash-step-cli | |
run: | | |
HASH=$(git rev-parse HEAD:packages/cli) | |
echo "::set-output name=hash::$HASH" | |
echo "Hash is: $HASH" | |
- name: Cache cli build | |
id: step-cache-build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-cli-build | |
with: | |
path: | | |
packages/cli/build | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ steps.folder-hash-step-cli.outputs.hash }} | |
- name: Cache node_modules | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules-test | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
- name: Build CLI | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
run: | | |
cd ./packages/cli/ | |
yarn build | |
build-composables: | |
name: Build composables package | |
needs: init | |
runs-on: ubuntu-latest | |
outputs: | |
package-hash: ${{ steps.folder-hash-step-composables.outputs.hash }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "16" | |
- name: Check hash for directory packages/composables | |
id: folder-hash-step-composables | |
run: | | |
HASH=$(git rev-parse HEAD:packages/composables) | |
echo "::set-output name=hash::$HASH" | |
echo "Hash is: $HASH" | |
- name: Cache composables build | |
id: step-cache-build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-composables-build | |
with: | |
path: | | |
packages/composables/dist | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ steps.folder-hash-step-composables.outputs.hash }} | |
- name: Cache node_modules | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules-test | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
- name: Build Composables | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
run: | | |
yarn build composables --release | |
build-helpers: | |
name: Build helpers package | |
needs: init | |
runs-on: ubuntu-latest | |
outputs: | |
package-hash: ${{ steps.folder-hash-step-helpers.outputs.hash }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "16" | |
- name: Check hash for directory packages/helpers | |
id: folder-hash-step-helpers | |
run: | | |
HASH=$(git rev-parse HEAD:packages/helpers) | |
echo "::set-output name=hash::$HASH" | |
echo "Hash is: $HASH" | |
- name: Cache helpers build | |
id: step-cache-build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-helpers-build | |
with: | |
path: | | |
packages/helpers/dist | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ steps.folder-hash-step-helpers.outputs.hash }} | |
- name: Cache node_modules | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules-test | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
- name: Build helpers | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
run: | | |
yarn build helpers --release | |
build-nuxt-module: | |
name: Build nuxt-module package | |
needs: init | |
runs-on: ubuntu-latest | |
outputs: | |
package-hash: ${{ steps.folder-hash-step-nuxt-module.outputs.hash }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "16" | |
- name: Check hash for directory packages/nuxt-module | |
id: folder-hash-step-nuxt-module | |
run: | | |
HASH=$(git rev-parse HEAD:packages/nuxt-module) | |
echo "::set-output name=hash::$HASH" | |
echo "Hash is: $HASH" | |
- name: Cache nuxt-module build | |
id: step-cache-build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-nuxt-module-build | |
with: | |
path: | | |
packages/nuxt-module/dist | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ steps.folder-hash-step-nuxt-module.outputs.hash }} | |
- name: Cache node_modules | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules-test | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
- name: Build nuxt-module | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
run: | | |
yarn build nuxt-module --release | |
build-shopware-6-client: | |
name: Build shopware-6-client package | |
needs: init | |
runs-on: ubuntu-latest | |
outputs: | |
package-hash: ${{ steps.folder-hash-step-shopware-6-client.outputs.hash }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "16" | |
- name: Check hash for directory packages/shopware-6-client | |
id: folder-hash-step-shopware-6-client | |
run: | | |
HASH=$(git rev-parse HEAD:packages/shopware-6-client) | |
echo "::set-output name=hash::$HASH" | |
echo "Hash is: $HASH" | |
- name: Cache shopware-6-client build | |
id: step-cache-build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-shopware-6-client-build | |
with: | |
path: | | |
packages/shopware-6-client/dist | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ steps.folder-hash-step-shopware-6-client.outputs.hash }} | |
- name: Cache node_modules | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules-test | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
- name: Build shopware-6-client | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
run: | | |
yarn build shopware-6-client --release | |
build-default-theme: | |
name: Build default-theme package | |
needs: init | |
runs-on: ubuntu-latest | |
outputs: | |
package-hash: ${{ steps.folder-hash-step-default-theme.outputs.hash }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "16" | |
- name: Check hash for directory packages/default-theme | |
id: folder-hash-step-default-theme | |
run: | | |
HASH=$(git rev-parse HEAD:packages/default-theme) | |
echo "::set-output name=hash::$HASH" | |
echo "Hash is: $HASH" | |
- name: Cache default-theme build | |
id: step-cache-build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-default-theme-build | |
with: | |
path: | | |
packages/default-theme/dist | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ steps.folder-hash-step-default-theme.outputs.hash }} | |
- name: Cache node_modules | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules-test | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
- name: Build default-theme | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
run: | | |
node scripts/linkDependencies.js && yarn lerna link | |
yarn build default-theme --release | |
publish: | |
name: Publish version | |
runs-on: ubuntu-latest | |
needs: | |
[ | |
build-cli, | |
build-composables, | |
build-helpers, | |
build-nuxt-module, | |
build-shopware-6-client, | |
build-default-theme, | |
] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "16" | |
registry-url: https://registry.npmjs.org/ | |
- name: Cache cli build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-cli-build | |
with: | |
path: | | |
packages/cli/build | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ needs.build-cli.outputs.package-hash }} | |
- name: Cache composables build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-composables-build | |
with: | |
path: | | |
packages/composables/dist | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ needs.build-composables.outputs.package-hash }} | |
- name: Cache helpers build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-helpers-build | |
with: | |
path: | | |
packages/helpers/dist | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ needs.build-helpers.outputs.package-hash }} | |
- name: Cache nuxt-module build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-nuxt-module-build | |
with: | |
path: | | |
packages/nuxt-module/dist | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ needs.build-nuxt-module.outputs.package-hash }} | |
- name: Cache shopware-6-client build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-shopware-6-client-build | |
with: | |
path: | | |
packages/shopware-6-client/dist | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ needs.build-shopware-6-client.outputs.package-hash }} | |
- name: Cache default-theme build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-default-theme-build | |
with: | |
path: | | |
packages/default-theme/dist | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ needs.build-default-theme.outputs.package-hash }} | |
- name: Cache node_modules | |
uses: actions/cache@v2 | |
id: step-cache-node-modules | |
env: | |
cache-name: cache-node-modules-test | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
- name: Publish canary version | |
run: | | |
yarn release --canary --skipBuild | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
build: | |
runs-on: ubuntu-latest | |
needs: publish | |
steps: | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "16" | |
registry-url: https://registry.npmjs.org/ | |
- name: Create default-theme project | |
run: | | |
mkdir app | |
cd ./app | |
npx @shopware-pwa/cli@canary init --u ${{ secrets.SHOPWARE_ADMIN_USER }} --p ${{ secrets.SHOPWARE_ADMIN_PASSWORD }} --shopwareDomainsAllowList=${{ env.PWA_HOST }} --shopwareDomainsAllowList=${{ env.PWA_HOST }}/germany --ci --devMode --stage canary | |
yarn build | |
- name: Build and publish docker image | |
uses: elgohr/Publish-Docker-Github-Action@v5 | |
with: | |
name: shopware-pwa-storefrontcloud-io/vue-storefront:${{ github.sha }} | |
registry: registry.storefrontcloud.io | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
workdir: ./app | |
buildoptions: "--compress" | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: chrnorm/deployment-action@releases/v1 | |
name: Create GitHub deployment | |
id: deployment | |
with: | |
token: "${{ github.token }}" | |
target_url: ${{ env.CANARY_URL }} | |
environment: canary | |
initial_status: in_progress | |
- name: Deploy on StorefrontCloud.io | |
run: | | |
if curl -H "X-User-Id: ${{ secrets.CLOUD_USERNAME }}" -H "X-Api-Key: ${{ secrets.CLOUD_PASSWORD }}" -H 'Content-Type: application/json' -X POST -d '{"code":"${{ env.INSTANCE_CODE }}","region":"europe-west1.gcp","frontContainerVersion":"${{ github.sha }}"}' https://farmer.storefrontcloud.io/instances | grep -q '{"code":200,"result":"Instance updated!"}'; then | |
echo "Instance updated" | |
else | |
echo "Deployment failed" | |
exit 1 | |
fi | |
- name: Update deployment status (success) | |
if: success() | |
uses: chrnorm/deployment-status@releases/v1 | |
with: | |
token: "${{ github.token }}" | |
target_url: ${{ env.CANARY_URL }} | |
state: "success" | |
description: Congratulations! The deploy is done. | |
deployment_id: ${{ steps.deployment.outputs.deployment_id }} | |
- name: Update deployment status (failure) | |
if: failure() | |
uses: chrnorm/deployment-status@releases/v1 | |
with: | |
token: "${{ github.token }}" | |
target_url: ${{ env.CANARY_URL }} | |
description: Unfortunately, the instance hasn't been updated. | |
state: "failure" | |
deployment_id: ${{ steps.deployment.outputs.deployment_id }} |