From 25ab797df580228c0d18699df2343c9c90a216a9 Mon Sep 17 00:00:00 2001 From: Alexander Morogov Date: Wed, 16 Sep 2020 15:56:55 +0200 Subject: [PATCH] VP-4625: Update workflow --- .github/workflows/main.yml | 77 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..a9d9070 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,77 @@ +# v1 +name: Theme CI +on: + workflow_dispatch: + push: + paths-ignore: + - '.github/**' + - 'docs/**' + - 'build/**' + - 'README.md' + - 'LICENSE' + branches: + [master, dev] + pull_request: + branches: + [master, dev] + paths-ignore: + - '.github/**' + - 'docs/**' + - 'build/**' + - 'README.md' + - 'LICENSE' + +jobs: + ci: + runs-on: ubuntu-latest + env: + SONAR_TOKEN: ${{secrets.SONAR_TOKEN}} + GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} + BLOB_SAS: ${{ secrets.BLOB_TOKEN }} + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup sonarqube + uses: warchant/setup-sonar-scanner@v1 + + - name: Get Image Version + uses: VirtoCommerce/vc-github-actions/get-image-version@master + id: image + + - name: Get changelog + id: changelog + uses: VirtoCommerce/vc-github-actions/changelog-generator@master + + - name: SonarCloud Scan + uses: VirtoCommerce/vc-github-actions/sonar-theme@master + + - name: Build + uses: VirtoCommerce/vc-github-actions/build-theme@master + + - name: Publish + id: publish + uses: VirtoCommerce/vc-github-actions/publish-theme@master + + - name: Create Release + if: github.ref == 'refs/heads/master' + id: create_release + uses: actions/create-release@v1 + with: + tag_name: ${{ steps.image.outputs.tag }} + release_name: ${{ steps.image.outputs.tag }} + draft: false + prerelease: false + body: ${{ steps.changelog.outputs.changelog }} + + - name: Upload Release Asset + if: github.ref == 'refs/heads/master' + id: upload-release-asset + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ${{ steps.publish.outputs.artifactPath }} + asset_name: ${{ steps.publish.outputs.artifactName }} + asset_content_type: application/zip