Skip to content

Commit

Permalink
Generate list of workshops from what is in the workshops directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamDumpleton committed Aug 9, 2023
1 parent b1007e6 commit 3bc9677
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/publish-workshops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:
publish-workshops:
runs-on: ubuntu-latest

if: ${{github.repository != 'vmware-tanzu-labs/educates-workshop-templates'}}

steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -30,21 +28,20 @@ jobs:
imgpkg pull -i ghcr.io/vmware-tanzu-labs/educates-client-programs:2.6.0-alpha.25 -o /tmp/client-programs
mv /tmp/client-programs/educates-linux-amd64 /usr/local/bin/educates
- name: Setup the list of workshop names
- name: Setup variables repository and release details
shell: bash
run: |
echo WORKSHOPS="lab-builtin-vcluster,lab-shared-vcluster,lab-remote-cluster" >>${GITHUB_ENV}
echo REPOSITORY_OWNER=$(echo "${{github.repository_owner}}" | tr '[:upper:]' '[:lower:]') >>${GITHUB_ENV}
echo REPOSITORY_NAME=${{github.event.repository.name}} >>${GITHUB_ENV}
echo REPOSITORY_TAG=$(echo "${{github.ref}}" | sed -e 's%refs/tags/%%') >>${GITHUB_ENV}
- name: Publish workshops and create workshop definition
shell: bash
run : |
for WORKSHOP in $(echo "$WORKSHOPS" | tr ',' '\n'); do
mkdir -p ${{runner.temp}}/workshops/${WORKSHOP}
educates publish-workshop workshops/${WORKSHOP} \
--export-workshop ${{runner.temp}}/workshops/${WORKSHOP}/workshop.yaml \
for WORKSHOP_DIRECTORY in workshops/*; do
mkdir -p ${{runner.temp}}/${WORKSHOP_DIRECTORY}
educates publish-workshop ${WORKSHOP_DIRECTORY} \
--export-workshop ${{runner.temp}}/${WORKSHOP_DIRECTORY}/workshop.yaml \
--repository=ghcr.io/${REPOSITORY_OWNER} \
--workshop-version=${REPOSITORY_TAG} \
--registry-username=${{github.actor}} \
Expand Down

0 comments on commit 3bc9677

Please sign in to comment.