From 29649646e3af6e419549d134607bee13e1c57bc0 Mon Sep 17 00:00:00 2001 From: xyny <60004820+xynydev@users.noreply.github.com> Date: Sun, 3 Mar 2024 20:14:06 +0000 Subject: [PATCH] ci: build and push all branches and other misc workflow changes (#156) (#161) * chore: cleanup build.yml run conditions - run on all branches - no need to run on schedule, since there's nothing external pulled in the image build * chore: change workflow name * fix: tag non-main-branch builds correctly * docs: yafti module explain what yafti is * ci: fix globs in website rebuild action * ci: only rebuild website if in official module repository * ci: fix globs being invalid yaml * Revert "docs: yafti module explain what yafti is" This reverts commit 7d5295cd9f9ea7d0f6a45ce227da6d699973cf2f. --- .github/workflows/build.yml | 14 +++++--------- .github/workflows/rebuild-website.yml | 7 ++++--- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d00ef92..4d5ed62 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,16 +1,10 @@ -name: build-stable +name: publish-modules on: push: - branches: - - main paths-ignore: # don't rebuild if only documentation has changed - "**.md" pull_request: - branches: ["main"] merge_group: - branches: ["main"] - schedule: - - cron: "0 5 * * *" # 5 am everyday workflow_dispatch: env: IMAGE_NAME: modules @@ -38,10 +32,12 @@ jobs: # Only perform the follow code when the action is spawned from a Pull Request if [[ "${{ github.event_name }}" == "pull_request" ]]; then alias_tags+=("pr-${{ github.event.number }}") - else + elif [[ "${{ github.ref_name }}" == "main" ]]; then # The following is run when the timer is triggered or a merge/push to main echo "date=$(date +%Y%m%d)" >> $GITHUB_OUTPUT - alias_tags+=("latest") + alias_tags+=("latest" "main") + else + alias_tags+=("${{ github.ref_name }}") fi echo "alias_tags=${alias_tags[*]}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/rebuild-website.yml b/.github/workflows/rebuild-website.yml index 7f0f35f..2fdbc5e 100644 --- a/.github/workflows/rebuild-website.yml +++ b/.github/workflows/rebuild-website.yml @@ -5,12 +5,13 @@ on: - main paths: # only rebuild when related files change - "**/module.yml" - - modules.json - - README.md + - "/modules.json" + - "**/README.md" jobs: rebuild-website: name: Trigger build hook for website on Netlify - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + if: github.repository == 'blue-build/modules' steps: - run: curl -X POST -d {} https://api.netlify.com/build_hooks/65bf6b0dd164b64659beafd5