This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: hide theme and cloud deploy (#413)
Co-authored-by: mkucmus <maciejkucmus@gmail.com>
- Loading branch information
Showing
76 changed files
with
1,694 additions
and
580 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: Deploy PR Preview on Storefrontcloud | ||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v1 | ||
- name: Setup node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: "12.x" | ||
- name: Build packages | ||
run: | | ||
yarn | ||
yarn build --ci | ||
- name: Create theme project | ||
run: | | ||
mkdir test-project | ||
cd ./test-project | ||
../packages/cli/bin/shopware-pwa init -u ${{ secrets.SHOPWARE_ADMIN_USER }} -p ${{ secrets.SHOPWARE_ADMIN_PASSWORD }} | ||
yarn build | ||
- name: Build and publish docker image | ||
uses: elgohr/Publish-Docker-Github-Action@master | ||
with: | ||
name: shopware-pwa-storefrontcloud-io/vue-storefront:${{ github.sha }} | ||
registry: registry.storefrontcloud.io | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
workdir: ./test-project | ||
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 }}" | ||
environment: preview | ||
initial_status: in_progress | ||
- run: echo ::set-env name=PULL_NUMBER::$(echo "$GITHUB_REF" | awk -F / '{print $3}') | ||
- name: Deploy on Storefrontcloud.io | ||
run: | | ||
# remove when fix on cloud is done | ||
curl -s -k https://${{ github.sha }}.shopware-pwa.storefrontcloud.io > /dev/null | ||
sleep 3 | ||
# /remove when fix on cloud is done | ||
if curl -s -k https://${{ github.sha }}.shopware-pwa.storefrontcloud.io | grep -q '<html data-n-head-ssr'; then | ||
echo "Instance updated" | ||
# curl -s -X GET \ | ||
# https://api.github.com/repos/DivanteLtd/shopware-pwa/issues/${{env.PULL_NUMBER}}/comments \ | ||
# -H 'Accept: application/vnd.github.shadow-cat-preview+json' | grep -B4 '\"login\": \"github-actions\[bot\]"' | grep -A1 '"issue_url":' > comments.json | ||
# grep -Po '"id": ([0-9]+)' comments.json > ids.json | ||
# while read p; do | ||
# commentId=$(echo $p|grep -o '[0-9]\+') | ||
# curl -s -X DELETE \ | ||
# https://api.github.com/repos/DivanteLtd/shopware-pwa/issues/comments/$commentId \ | ||
# -H "Authorization: token ${{ github.token }}" | ||
# done <ids.json | ||
else | ||
echo "Something went wrong during the update process..." | ||
exit 1 | ||
fi | ||
- name: Update deployment status (success) | ||
if: success() | ||
uses: chrnorm/deployment-status@releases/v1 | ||
with: | ||
token: "${{ github.token }}" | ||
target_url: https://${{ github.sha }}.shopware-pwa.storefrontcloud.io | ||
state: "success" | ||
description: Congratulations! The deploy is done. | ||
deployment_id: ${{ steps.deployment.outputs.deployment_id }} | ||
- name: Comment PR | ||
if: success() | ||
uses: thollander/actions-comment-pull-request@master | ||
with: | ||
message: ':blue_heart: Shopware-PWA successfully deployed on https://${{ github.sha }}.shopware-pwa.storefrontcloud.io :ok_hand:' | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Update deployment status (failure) | ||
if: failure() | ||
uses: chrnorm/deployment-status@releases/v1 | ||
with: | ||
token: "${{ github.token }}" | ||
description: Unfortunately, the instance hasn't been updated. | ||
state: "failure" | ||
deployment_id: ${{ steps.deployment.outputs.deployment_id }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Deploy to Storefrontcloud | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v1 | ||
- name: Setup node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: "12.x" | ||
- name: Build packages | ||
run: | | ||
yarn | ||
yarn build --ci | ||
- name: Create theme project | ||
run: | | ||
mkdir test-project | ||
cd ./test-project | ||
../packages/cli/bin/shopware-pwa init -u ${{ secrets.SHOPWARE_ADMIN_USER }} -p ${{ secrets.SHOPWARE_ADMIN_PASSWORD }} | ||
yarn build | ||
- name: Build and publish docker image | ||
uses: elgohr/Publish-Docker-Github-Action@master | ||
with: | ||
name: shopware-pwa-storefrontcloud-io/vue-storefront:${{ github.sha }} | ||
registry: registry.storefrontcloud.io | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
workdir: ./test-project | ||
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: https://shopware-pwa.storefrontcloud.io | ||
environment: production | ||
initial_status: in_progress | ||
- name: Deploy on Storefrontcloud.io | ||
run: | | ||
if curl -s -u ${{ secrets.DOCKER_USERNAME }}:${{ secrets.DOCKER_PASSWORD }} -H 'Content-Type: application/json' -X POST -d '{"code":"shopware-pwa","frontContainerVersion":"${{ github.sha }}"}' https://farmer.storefrontcloud.io/instances | grep -q '{"code":200,"result":"Instance updated!"}'; then | ||
echo "Instance updated" | ||
else | ||
echo "Something went wrong during the update process..." | ||
exit 1 | ||
fi | ||
- name: Update deployment status (success) | ||
if: success() | ||
uses: chrnorm/deployment-status@releases/v1 | ||
with: | ||
token: "${{ github.token }}" | ||
target_url: https://shopware-pwa.storefrontcloud.io | ||
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: https://shopware-pwa.storefrontcloud.io | ||
description: Unfortunately, the instance hasn't been updated. | ||
state: "failure" | ||
deployment_id: ${{ steps.deployment.outputs.deployment_id }} |
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
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
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
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
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
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
Oops, something went wrong.