-
-
Notifications
You must be signed in to change notification settings - Fork 1
v4 #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+95
−69
Merged
v4 #4
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a6e656a
refactor: rename args, add validation & Pages
ArnaudLigny 1a8f5fb
Remove config input and unify options
ArnaudLigny 08b5f58
Resolve output dir and refactor action.yml
ArnaudLigny 789c879
Potential fix for pull request finding
ArnaudLigny 4c20be2
Potential fix for pull request finding
ArnaudLigny 2b0614e
Potential fix for pull request finding
ArnaudLigny 7194507
Potential fix for pull request finding
ArnaudLigny 1c56212
Handle boolean install_themes input in theme install condition
Copilot e14267f
Use consistent quoting in install_themes condition
Copilot 5aed185
Quote install_themes default value
Copilot b541974
CI: bump action version and remove PHP setup
ArnaudLigny 4cac61c
Reorder options input and update README
ArnaudLigny 455fd3a
Enhance test workflow with deploy and concurrency
ArnaudLigny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,5 @@ jobs: | |
| uses: ./ | ||
| with: | ||
| version: '8.93.1' | ||
| config: 'config.yml' | ||
| args: '-vv' | ||
| options: '-vv' | ||
| install_themes: 'yes' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,45 +1,79 @@ | ||
| name: 'Cecil Action' | ||
| description: 'Build a Cecil static site.' | ||
| author: 'Arnaud Ligny' | ||
| inputs: | ||
| name: "Cecil Action" | ||
| description: "Build a Cecil static site." | ||
| author: "Arnaud Ligny" | ||
| inputs: | ||
| options: | ||
| description: "Cecil options (optional, `-v` by default)." | ||
| default: -v | ||
| version: | ||
| description: 'Cecil version (optional, last version by default).' | ||
| config: | ||
| description: 'Cecil configuration file (optional, `cecil.yml` by default).' | ||
| args: | ||
| description: 'Cecil arguments (optionnal, `-v` by default).' | ||
| default: '-v' | ||
| description: "Cecil version (optional, last version by default)." | ||
| install_themes: | ||
| description: 'Use "no" to do not install theme(s) (optionnal, `yes` by default).' | ||
| default: 'yes' | ||
| description: "Use `no` to do not install theme(s) (optional, `yes` by default)." | ||
|
ArnaudLigny marked this conversation as resolved.
Outdated
|
||
| default: yes | ||
|
ArnaudLigny marked this conversation as resolved.
Outdated
|
||
| branding: | ||
| icon: 'package' | ||
| color: 'white' | ||
| icon: package | ||
| color: white | ||
| runs: | ||
| using: 'composite' | ||
| using: composite | ||
| steps: | ||
| - run: | | ||
| # Downloading Cecil | ||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: pre-installed | ||
| extensions: mbstring, fileinfo, gd, imagick, intl, gettext, :redis | ||
| - name: Validate Cecil version | ||
| shell: bash | ||
| run: | | ||
| version="${{ inputs.version }}" | ||
| if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([\-+].*)?$ ]]; then | ||
|
ArnaudLigny marked this conversation as resolved.
Outdated
|
||
| echo "Invalid Cecil version: '$version' (expected e.g. 8.76.3)" >&2 | ||
| exit 1 | ||
| fi | ||
| - name: Downloading Cecil | ||
| shell: bash | ||
| run: | | ||
| if [[ -z "${{ inputs.version }}" ]]; then | ||
| echo "Downloading Cecil..." | ||
| echo "Downloading latest Cecil..." | ||
| curl -sSOL https://cecil.app/cecil.phar | ||
| else | ||
| echo "Downloading Cecil ${{ inputs.version }}..." | ||
| curl -sSOL https://cecil.app/download/${{ inputs.version }}/cecil.phar | ||
| fi | ||
| # Installing theme(s) | ||
| - name: Installing theme(s) | ||
| shell: bash | ||
| run: | | ||
| if [[ -f "composer.json" && ${{ inputs.install_themes }} = 'yes' ]]; then | ||
| echo "Installing theme(s)..." | ||
| composer install --prefer-dist --no-dev --no-progress --no-interaction --quiet | ||
| fi | ||
| # Running build | ||
| if [[ -z "${{ inputs.config }}" ]]; then | ||
| php cecil.phar build ${{ inputs.args }} | ||
| else | ||
| php cecil.phar build ${{ inputs.args }} --config=${{ inputs.config }} | ||
| fi | ||
| - name: Setup GitHub Pages | ||
| id: pages | ||
| uses: actions/configure-pages@v6 | ||
| - name: Building site with Cecil | ||
| shell: bash | ||
| run: | | ||
| php cecil.phar build ${{ inputs.options }} --baseurl="${{ steps.pages.outputs.base_url }}/" | ||
| # Summary | ||
| if [ $? == 0 ]; then | ||
| echo "Site built with Cecil ${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY | ||
| fi | ||
| - name: Resolve output directory | ||
| id: output | ||
| shell: bash | ||
| run: | | ||
| options='${{ inputs.options }}' | ||
| output_dir="_site" | ||
| if [[ "$options" =~ (^|[[:space:]])--output=([^[:space:]]+) ]]; then | ||
| output_dir="${BASH_REMATCH[2]}" | ||
| elif [[ "$options" =~ (^|[[:space:]])--output[[:space:]]+([^[:space:]]+) ]]; then | ||
| output_dir="${BASH_REMATCH[2]}" | ||
| elif [[ "$options" =~ (^|[[:space:]])-o[[:space:]]+([^[:space:]]+) ]]; then | ||
| output_dir="${BASH_REMATCH[2]}" | ||
| elif [[ "$options" =~ (^|[[:space:]])-o([^[:space:]]+) ]]; then | ||
| output_dir="${BASH_REMATCH[2]}" | ||
| fi | ||
| echo "output_dir=$output_dir" >> "$GITHUB_OUTPUT" | ||
| - name: Upload GitHub Pages artifact | ||
| uses: actions/upload-pages-artifact@v5 | ||
| with: | ||
| path: ./${{ steps.output.outputs.output_dir }} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.