diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..dd114bbe --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,10 @@ +Description: + + +-- + +QA-test: + +Demo-test: + +Download artifact URL: diff --git a/.github/workflows/deploy-pr.yml b/.github/workflows/deploy-pr.yml new file mode 100644 index 00000000..d0c1b1f1 --- /dev/null +++ b/.github/workflows/deploy-pr.yml @@ -0,0 +1,53 @@ +# v1.0 + +name: Deploy Theme to environments +on: + pull_request: + paths-ignore: + - '.github/**' + - 'docs/**' + - 'build/**' + - 'README.md' + - 'LICENSE' + branches: [dev] + types: [labeled, closed] + +jobs: + deploy: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} + + steps: + - name: Gets artifact link + id: artifactLink + uses: VirtoCommerce/vc-github-actions/get-artifact-link@master + + - name: Create deploy PR in QA + if: github.event.action != 'closed' && contains(github.event.pull_request.labels.*.name, 'deploy-qa') && !contains(github.event.pull_request.labels.*.name, 'deploy-demo') + uses: VirtoCommerce/vc-github-actions/create-deploy-pr@master + with: + deployRepo: "vc-webstore-deploy" + deployBranch: "qa" + artifactKey: "B2B_THEME_URL" + artifactUrl: "${{ steps.artifactLink.outputs.artifactUrl }}" + taskNumber: "${{ steps.artifactLink.outputs.qaTaskNumber }}" + + - name: Create deploy PR in Demo + if: github.event.action == 'closed' && github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'deploy-demo') + uses: VirtoCommerce/vc-github-actions/create-deploy-pr@master + with: + deployRepo: "vc-webstore-deploy" + deployBranch: "master" + artifactKey: "B2B_THEME_URL" + artifactUrl: "${{ steps.artifactLink.outputs.artifactUrl }}" + taskNumber: "${{ steps.artifactLink.outputs.demoTaskNumber }}" + + - name: Deploy to Dev + if: github.event.action == 'closed' && github.event.pull_request.merged == true + uses: benc-uk/workflow-dispatch@v1 + with: + workflow: Theme deployment + token: ${{ secrets.REPO_TOKEN }} + inputs: '{ "blobUrl": "${{ steps.artifactLink.outputs.artifactUrl }}", "artifactVersion": "PR-${{ github.event.pull_request.number }}", "key": "B2B_THEME_URL" }' + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8ee7cd76..23fd3051 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -147,7 +147,7 @@ jobs: update_latest: ${{ env.UPDATE_LATEST_TAG }} - name: Invoke VC image deployment workflow - if: ${{ github.ref == 'refs/heads/dev' || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master')}} + if: ${{(github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master')}} uses: benc-uk/workflow-dispatch@v1 with: workflow: VC image deployment