fix: deleting active custom uploader no longer deletes all custom upl… #6
This file contains 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
name: Deploy README to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'README.md' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Check if only README.md changed | |
run: | | |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
echo "Manually triggered - skipping file check." | |
echo "only_readme_changed=true" >> $GITHUB_ENV | |
else | |
FILE_LIST=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -v 'README.md') | |
if [ -z "$FILE_LIST" ]; then | |
echo "Only README.md changed." | |
echo "only_readme_changed=true" >> $GITHUB_ENV | |
else | |
echo "Other files changed." | |
echo "only_readme_changed=false" >> $GITHUB_ENV | |
fi | |
fi | |
- name: Download and Save appcast.xml | |
if: env.only_readme_changed == 'true' | |
run: | | |
curl -o ./appcast.xml https://isharemac.app/appcast.xml | |
echo "File downloaded and saved as appcast.xml" | |
- name: Setup Pages | |
if: env.only_readme_changed == 'true' | |
uses: actions/configure-pages@v3 | |
- name: Build with Jekyll | |
if: env.only_readme_changed == 'true' | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: ./ | |
destination: ./_site | |
- name: Upload artifact | |
if: env.only_readme_changed == 'true' | |
uses: actions/upload-pages-artifact@v2 | |
- name: Deploy to GitHub Pages | |
if: env.only_readme_changed == 'true' | |
id: deployment | |
uses: actions/deploy-pages@v2 |