gha v1 #1
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: main | |
on: push | |
jobs: | |
configure: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- name: Checkout to repository | |
uses: actions/checkout@v3 | |
- name: Set matrix data | |
id: set-matrix | |
run: echo "matrix=$(jq -c . < ./modules.json)" >> $GITHUB_OUTPUT | |
print: | |
runs-on: ubuntu-latest | |
needs: configure | |
strategy: | |
matrix: | |
modules: | |
- ${{ fromJson(needs.configure.outputs.matrix).modules }} | |
- "combined" | |
steps: | |
- run: echo ${{ matrix.modules }} | |
makeNames: | |
runs-on: ubuntu-latest | |
needs: configure | |
strategy: | |
matrix: | |
modules: | |
- ${{ fromJson(needs.configure.outputs.matrix).modules }} | |
- "combined" | |
steps: | |
- name: Checkout Ref | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
#ref: ${{ inputs.tag }} | |
- name: Restore Cached Files | |
uses: actions/cache@v3 | |
id: cache | |
with: | |
path: | | |
~/.npm | |
./.cache | |
./tools/node_modules | |
key: ${{ runner.os }}-bunny-${{ hashFiles('**/.cache', '**/package-lock.json', '**/manifest.json') }} | |
restore-keys: ${{ runner.os }}-bunny- | |
- name: Setup NodeJS v16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
check-latest: true | |
- name: Setup NPM Packages | |
working-directory: ./tools | |
run: npm ci | |
- working-directory: ./tools | |
run: npx gulp makeGHAName | |
id: name | |
env: | |
MODULE: ${{ matrix.modules }} | |
- uses: cloudposse/[email protected] | |
with: | |
matrix-step-name: ${{ github.job }} | |
matrix-key: ${{ matrix.modules }} | |
outputs: |- | |
FILE_NAME=${{ steps.name.outputs.file }} | |
read: | |
runs-on: ubuntu-latest | |
needs: [makeNames] | |
steps: | |
- uses: cloudposse/[email protected] | |
id: read | |
with: | |
matrix-step-name: makeNames | |
outputs: | |
result: "${{ steps.read.outputs.result }}" | |
printNames: | |
runs-on: ubuntu-latest | |
needs: [configure, read] | |
strategy: | |
matrix: | |
modules: | |
- ${{ fromJson(needs.configure.outputs.matrix).modules }} | |
- "combined" | |
steps: | |
- run: echo ${{ fromJson(needs.read.outputs.result).FILE_NAME[matrix.modules] }} |