Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
VDS-1223: Add deploy-pr workflow (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvktsk authored Apr 12, 2021
1 parent 3a047c0 commit 3ce251f
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Description:


--

QA-test:

Demo-test:

Download artifact URL:
53 changes: 53 additions & 0 deletions .github/workflows/deploy-pr.yml
Original file line number Diff line number Diff line change
@@ -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" }'

2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3ce251f

Please sign in to comment.