Skip to content

Commit

Permalink
trying a leaner version of preview
Browse files Browse the repository at this point in the history
  • Loading branch information
shacharmirkin committed Aug 20, 2024
1 parent ca1f53b commit 6909466
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 80 deletions.
97 changes: 26 additions & 71 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,79 +3,34 @@ name: Preview Site
on:
push:
branches-ignore:
- main # or master, depending on your default branch name
- main

jobs:
build-preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"

- name: Install dependencies
run: |
gem install bundler
bundle install
- name: Display repository contents
run: |
echo "==================== REPOSITORY CONTENTS ===================="
ls -R
echo "==================== END OF REPOSITORY CONTENTS ===================="
- name: Display index.md content (if exists)
run: |
echo "==================== INDEX.MD CONTENT ===================="
if [ -f "index.md" ]; then
cat index.md
else
echo "index.md not found"
find . -name "index.md"
fi
echo "==================== END OF INDEX.MD CONTENT ===================="
- name: Display _config.yml content
run: |
echo "==================== _CONFIG.YML CONTENT ===================="
if [ -f "_config.yml" ]; then
cat _config.yml
else
echo "_config.yml not found"
find . -name "_config.yml"
fi
echo "==================== END OF _CONFIG.YML CONTENT ===================="
- name: Build site
run: bundle exec jekyll build --verbose

- name: List built files
run: |
echo "==================== START OF BUILT FILES ===================="
ls -R _site
echo "==================== END OF BUILT FILES ===================="
- name: Deploy preview
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site
destination_dir: preview/${{ github.ref_name }}

- name: Debug - List gh-pages branch
run: |
git fetch origin gh-pages:gh-pages
git checkout gh-pages
echo "==================== START OF GH-PAGES CONTENT ===================="
ls -R preview
echo "==================== END OF GH-PAGES CONTENT ===================="
- name: Print preview URL
run: |
echo "==================== PREVIEW URL ===================="
echo "https://shacharmirkin.github.io/preview/${{ github.ref_name }}/"
echo "======================================================"
- uses: actions/checkout@v3

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'

- name: Install dependencies
run: |
gem install bundler
bundle install
- name: Build site
run: bundle exec jekyll build

- name: Deploy preview
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site
destination_dir: preview/${{ github.ref_name }}

- name: Print preview URL
run: |
echo "Preview available at: https://shacharmirkin.github.io/preview/${{ github.ref_name }}/"
6 changes: 1 addition & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
source "https://rubygems.org"

gem "github-pages", group: :jekyll_plugins
gem "jekyll-remote-theme"

group :jekyll_plugins do
# Add other plugins here if you have any
end
gem "jekyll-remote-theme"
4 changes: 0 additions & 4 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,4 @@ W-NUT 2022 // ARR April 2022 / ACL 2022 (ARR) // W-NUT 2021 // EMNLP 2021 // EAC

[Twitter](https://twitter.com/shacharmirkin)

[Facebook](https://www.facebook.com/shacharm)

[LinkedIn](https://www.linkedin.com/public-profile/in/shacharmirkin)

<a rel="me" href="https://sigmoid.social/@shacharmirkin">Mastodon</a>

0 comments on commit 6909466

Please sign in to comment.