add jetbrains IDE support for license check #59
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: Prebuild core & vite apps | |
on: | |
pull_request: | |
types: | |
- opened | |
issue_comment: | |
types: | |
- created | |
workflow_dispatch: | |
jobs: | |
build: | |
if: github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' || contains(github.event.comment.body, '/build') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Show GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- uses: actions/github-script@v6 | |
if: github.event_name == 'pull_request' || contains(github.event.comment.body, '/build') | |
id: get-head | |
with: | |
script: | | |
const request = { | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
pull_number: context.issue.number | |
} | |
core.info(`Getting PR #${request.pull_number} from ${request.owner}/${request.repo}`) | |
try { | |
const result = await github.rest.pulls.get(request) | |
core.setOutput('head_ref', result.data.head.ref) | |
} catch (err) { | |
core.setFailed(`Request failed with error ${err}`) | |
} | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
# Get the branch name if steps.get-head.outputs.head_ref is defined or github.ref_name if event name == workflow_dispatch | |
ref: ${{ steps.get-head.outputs.head_ref || github.ref_name }} | |
- name: Build Docker image | |
run: docker build . -t prebuild -f ./docker/DOCKERFILES/build/prebuild.Dockerfile | |
- name: Run Docker container | |
run: docker run --name prebuild prebuild | |
- name: Copy apps/core/dist | |
run: docker cp prebuild:/app/apps/core/dist ./apps/core | |
- name: Copy apps/core/applications | |
run: docker cp prebuild:/app/apps/core/applications ./apps/core | |
- name: Store branch variable, if event name == workflow_dispatch or steps.get-head.outputs.head_ref is defined | |
id: get-branch | |
run: | | |
if [ "${{ github.event_name }}" == 'workflow_dispatch' ]; then | |
echo ::set-output name=branch::${{ github.ref_name }} | |
else | |
branch_ref=${{ steps.get-head.outputs.head_ref }} | |
if [ "$branch_ref" != "null" ]; then | |
echo ::set-output name=branch::${branch_ref} | |
else | |
echo ::set-output name=branch::master | |
fi | |
fi | |
- name: Create an artifact for core/dist and core/applications | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist-artifact-${{ steps.get-branch.outputs.branch }} | |
path: | | |
apps/core/dist | |
apps/core/applications | |
retention-days: 30 |