Skip to content

Commit

Permalink
restore mtime before generating pages
Browse files Browse the repository at this point in the history
  • Loading branch information
takase1121 committed Mar 7, 2024
1 parent a48bc32 commit 171e2d0
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,41 @@ jobs:
# if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Restore file mtime
run: |
git ls-files -z | while read -d '' path; do
touch -d $(git log -1 --format="@%ct" "$path") "$path"
done
- name: Install ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7

- name: Install gems
run: gem install redcarpet rouge

- name: Set environment variables
run: echo "SITE_ROOT=deploy" >> $GITHUB_ENV

- name: Build (for forks)
if: ${{ github.repository_owner != 'lite-xl' }}
run: ruby site.rb "/$(echo '${{ github.repository }}' | cut -d/ -f2)"

- name: Build (for lite-xl org)
if: ${{ github.repository_owner == 'lite-xl' }}
run: ruby site.rb

- name: Upload to GitHub pages (for lite-xl org)
if: ${{ github.repository_owner == 'lite-xl' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./deploy
cname: lite-xl.com

- name: Upload to GitHub pages (for forks)
if: ${{ github.repository_owner != 'lite-xl' }}
uses: peaceiris/actions-gh-pages@v3
Expand Down

0 comments on commit 171e2d0

Please sign in to comment.