Skip to content

Commit

Permalink
trigger build
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmcguin committed May 15, 2024
1 parent 40d1938 commit fbf85b8
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 29 deletions.
40 changes: 23 additions & 17 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,35 @@ jobs:
sites:
- "sites/**/*"
# helper to extract the sites that were modified
# input_string="/home/sites/my-site/src/index.html"; echo "${input_string#*/sites/}" | cut -d'/' -f1
# run only if some file in 'src' folder was changed
# - if: steps.files_changed.outputs.src == 'true'
# run: ...
- name: Build Matrix
id: sites_matrix
run: |
site_paths=(${{steps.files_changed.outputs.sites_files}})
echo SITE_PATHS="${site_paths[@]}"
sites=()
for i in "${site_paths[@]}";
do
sites_directory="${i#*sites/}"
sites_directory="${sites_directory%%/*}"
sites+=("$sites_directory")
done
# unique_sites=$(echo $sites | tr ' ' '\n' | sort | uniq)
# echo UNIQUE_SITES=$unique_sites
# echo SITES="${unique_sites[@]}" >> $GITHUB_OUTPUT;
if [${{steps.files_changed.outputs.deps == "true"}}] || [${{steps.files_changed.outputs.lib == "true"}}]
then
# core changes - deploy all sites
echo SITES=$()
unique_sites=($(echo "${sites[@]}" | tr ' ' '\n' | sort -u))
echo SITES="${unique_sites[@]}";
# all_sites=($(find ./sites -maxdepth 1 -mindepth 1 -type d ! -name ./sites -exec basename {} \;))
# echo SITES="${all_sites[@]}"
echo SITES=($(find ./sites -maxdepth 1 -mindepth 1 -type d ! -name ./sites -exec basename {} \;)) >> $GITHUB_OUTPUT;
elif [${{steps.files_changed.outputs.sites == "true"}}]
then
site_paths=(${{steps.files_changed.outputs.sites_files}})
sites=()
for i in "${site_paths[@]}";
do
sites_directory="${i#*sites/}"
sites_directory="${sites_directory%%/*}"
sites+=("$sites_directory")
done
unique_sites=($(echo "${sites[@]}" | tr ' ' '\n' | sort -u))
echo SITES="${unique_sites[@]}" >> $GITHUB_OUTPUT;
else
echo SITES=$() >> $GITHUB_OUTPUT;
fi
- name: List Changed Files
run: |
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/components/Job.astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const { job } = Astro.props
<article class="heti">
<header>
<h2 class="post-title!">
New edit
<a href={`/jobs/${job.slug}/`}>{job.title}</a>
</h2>
<div class="mt-2 text-3.5">
Expand Down
29 changes: 17 additions & 12 deletions scripts/sites-matrix.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
#!/bin/bash

site_paths=("sites/site-1/index.html" "sites/site-2/index.html" "sites/site-2/index.html" "sites/site-4/index.html")
sites=()
for i in "${site_paths[@]}";
do
sites_directory="${i#*sites/}"
sites_directory="${sites_directory%%/*}"
sites+=("$sites_directory")
done
echo SITES="${sites[@]}";

unique_strings=($(echo "${sites[@]}" | tr ' ' '\n' | sort -u))
echo UNIQ="${unique_strings[@]}";
# site_paths=("sites/site-1/index.html" "sites/site-2/index.html" "sites/site-2/index.html" "sites/site-4/index.html")
# sites=()
# for i in "${site_paths[@]}";
# do
# sites_directory="${i#*sites/}"
# sites_directory="${sites_directory%%/*}"
# sites+=("$sites_directory")
# done
# echo SITES="${sites[@]}";
#
# unique_strings=($(echo "${sites[@]}" | tr ' ' '\n' | sort -u))
# echo UNIQ="${unique_strings[@]}";



all_sites=($(find ./sites -maxdepth 1 -mindepth 1 -type d ! -name ./sites -exec basename {} \;))
echo "${all_sites[@]}"

0 comments on commit fbf85b8

Please sign in to comment.