This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
chore(release): v1.6.2 #209
Workflow file for this run
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: Deploy to Storefrontcloud | |
on: | |
push: | |
tags: | |
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 | |
workflow_dispatch: | |
env: | |
RELEASE_URL: https://shopware-pwa.storefrontcloud.io | |
INSTANCE_CODE: shopware-pwa | |
EXPERIMENTAL_IMAGE_PROCESSING_SERVER: https://test-shopware-pwa-images.vercel.app/api/image | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "16" | |
registry-url: https://registry.npmjs.org/ | |
- name: Create project (release) | |
run: | | |
mkdir test-project | |
cd ./test-project | |
npx @shopware-pwa/cli@latest init --ci --devMode --shopwareDomainsAllowList=${{ env.RELEASE_URL }} --shopwareDomainsAllowList=${{ env.RELEASE_URL }}/de | |
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: ./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: ${{ env.RELEASE_URL }} | |
environment: production | |
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.RELEASE_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.RELEASE_URL }} | |
description: Unfortunately, the instance hasn't been updated. | |
state: "failure" | |
deployment_id: ${{ steps.deployment.outputs.deployment_id }} |