Build remote branch: rete/retejs#main #4
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: Build remote branch | |
run-name: "Build remote branch: ${{ inputs.repo }}#${{ inputs.branch }}" | |
on: | |
workflow_call: | |
inputs: | |
repo: | |
description: 'Repository' | |
type: string | |
required: true | |
branch: | |
description: 'Branch' | |
type: string | |
required: true | |
outputs: | |
artifact: | |
description: "Artifact name" | |
value: ${{ jobs.build.outputs.name }} | |
secrets: | |
RETE_QA_PUBLIC_PULL: | |
description: 'GitHub Personal access token' | |
required: true | |
workflow_dispatch: | |
inputs: | |
repo: | |
description: 'Repository' | |
required: true | |
branch: | |
description: 'Branch' | |
required: true | |
jobs: | |
build: | |
name: Build ${{ inputs.repo }}#${{ inputs.branch }} | |
runs-on: ubuntu-latest | |
outputs: | |
name: ${{ steps.package-info.outputs.name }} | |
steps: | |
- name: Info | |
run: | | |
echo "Repository: ${{ inputs.repo }}" | |
echo "Branch: ${{ inputs.branch }}" | |
- uses: actions/checkout@v3 | |
with: | |
repository: ${{ inputs.repo }} | |
token: ${{ secrets.RETE_QA_PUBLIC_PULL }} | |
ref: ${{ inputs.branch }} | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
- name: Install dependencies | |
run: npm ci | |
- name: Run build | |
run: npm run build | |
- name: Get npm package name | |
id: package-info | |
working-directory: dist | |
run: | | |
echo "name=$(node -p "require('./package.json').name")" >> $GITHUB_OUTPUT | |
- name: Print package info | |
run: echo ${{ steps.package-info.outputs.name }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.package-info.outputs.name }} | |
path: dist |