Skip to content

Fix syntax errors

Fix syntax errors #8

name: Create Artifacts on Push
on:
push:
branches:
- alek/artifacts # Specify the branches you want to trigger this action on
jobs:
zip-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup zip utility
run: sudo apt-get install -y zip
- name: List subfolders and prepare for matrix
id: prepare_matrix
run: |
folders=$(find . -maxdepth 1 -mindepth 1 -type d -exec basename {} \;)
echo "Found folders: $folders"
folders_json=$(echo "$folders" | jq -cR 'split(" ")')
echo "::set-output name=matrix::$folders_json"
upload-artifacts:
needs: zip-and-publish
runs-on: ubuntu-latest
strategy:
matrix:
folder: ${{ fromJson(needs.zip-and-publish.outputs.matrix) }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup zip utility
run: sudo apt-get install -y zip
- name: Zip the folder
run: zip -r "${{ matrix.folder }}.zip" "${{ matrix.folder }}"
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.folder }}
path: ${{ matrix.folder }}.zip