From fa97e2a276bc5d2136ddcec52c2f53fdd2a2080d Mon Sep 17 00:00:00 2001 From: zenobit Date: Tue, 8 Oct 2024 05:03:06 +0200 Subject: [PATCH] Create count_themes.yml --- .github/workflows/count_themes.yml | 32 +++++++++++++++++++++++++++ .github/workflows/jekyll-gh-pages.yml | 14 ------------ 2 files changed, 32 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/count_themes.yml diff --git a/.github/workflows/count_themes.yml b/.github/workflows/count_themes.yml new file mode 100644 index 0000000..747d0e6 --- /dev/null +++ b/.github/workflows/count_themes.yml @@ -0,0 +1,32 @@ +name: Create envfile + +on: [ push ] + +jobs: + + count: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Count themes + run: | + THEMES_NUMBER=$(ls ./themes/ | wc -l) + echo "Themes counted: $THEMES_NUMBER" + echo "THEMES_NUMBER=$THEMES_NUMBER" >> $GITHUB_ENV + - name: Export one variable + uses: UnlyEd/github-action-store-variable@v2.1.0 + with: + variables: THEMES_NUMBER="$THEMES_NUMBER" + + create-envfile: + needs: count + runs-on: ubuntu-latest + steps: + - name: Make envfile + uses: SpicyPizza/create-envfile@v2.0 + with: + envkey_THEMES_NUMBER: ${{ vars.THEMES_NUMBER }} + file_name: .env + fail_on_empty: true + sort_keys: false diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml index 59bc8d1..e31d81c 100644 --- a/.github/workflows/jekyll-gh-pages.yml +++ b/.github/workflows/jekyll-gh-pages.yml @@ -22,20 +22,6 @@ concurrency: cancel-in-progress: false jobs: - count: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Count themes - run: | - THEMES_NUMBER=$(ls ./themes/ | wc -l) - echo "Themes counted: $THEMES_NUMBER" - echo "THEMES_NUMBER=$THEMES_NUMBER" >> $GITHUB_ENV - - name: Export one variable - uses: UnlyEd/github-action-store-variable@v2.1.0 - with: - variables: THEMES_NUMBER="$THEMES_NUMBER" # Build job build: runs-on: ubuntu-latest