Skip to content

Commit

Permalink
fix preview location
Browse files Browse the repository at this point in the history
  • Loading branch information
shacharmirkin committed Aug 20, 2024
1 parent 331fa5d commit e42d188
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 74 deletions.
52 changes: 0 additions & 52 deletions .github/preview.yml

This file was deleted.

64 changes: 42 additions & 22 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,50 @@ name: Preview Site
on:
push:
branches-ignore:
- main # or master, depending on your default branch name
- main # or master, depending on your default branch name

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

- 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 }}
- 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 --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 "======================================================"

0 comments on commit e42d188

Please sign in to comment.