Update .gitea/workflows/build.yml
This commit is contained in:
@@ -11,6 +11,11 @@ on:
|
||||
jobs:
|
||||
Build:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
# js-file: name of the output (choosen here)
|
||||
# steps-js-filename -> The ID of the step which will produce a output (see Publish JS Filename Step)
|
||||
# script-file -> The key name which contains the output (saved by the step - see Publish JS Filename Step)
|
||||
js-file: ${{ steps.publish-js-filename.outputs.script-file }}
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
@@ -24,6 +29,10 @@ jobs:
|
||||
run: npm test
|
||||
- name: Build
|
||||
run: npm run build
|
||||
- name: Publish JS Filename
|
||||
id: publish-js-filename
|
||||
# Finds the desired Javascript file and prints a string 'script-file=<JS-FILENAME>' which then gets saved in the $GITHUB_OUTPUT file
|
||||
run: find dist/assets/*.js -type f -execdir echo 'script-file={}' >> $GITHUB_OUTPUT ';'
|
||||
- name: Package Artifacts
|
||||
uses: https://github.com/thedoctor0/zip-release@0.7.1
|
||||
with:
|
||||
@@ -43,6 +52,10 @@ jobs:
|
||||
uses: https://github.com/actions/download-artifact@v3
|
||||
with:
|
||||
name: dist.tar.gz
|
||||
- name: Output JS Filename from Build Job
|
||||
# needs can access all previous jobs an their outputs if the current job is in their 'needs' chain
|
||||
# js-file -> The output key defined in the Build job outputs area
|
||||
run: echo "${{ needs.build.outputs.js-file }}"
|
||||
- name: Deploy
|
||||
run: |
|
||||
echo Deploying...
|
||||
|
||||
Reference in New Issue
Block a user