Skip to content

Commit

Permalink
dummy commit (#81)
Browse files Browse the repository at this point in the history
Refactor pages deploy workflow

---------

Co-authored-by: Cocoa <[email protected]>
  • Loading branch information
momijizukamori and Cocoa authored Feb 4, 2024
1 parent f4bb630 commit 9f5534d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 38 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
contents: write
pages: write
id-token: write

Expand Down Expand Up @@ -39,13 +39,9 @@ jobs:
run: npm install
- name: Build
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
# Upload dist repository
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
folder: dist # The folder the action should deploy.
clean-exclude: pr-preview/
force: false
35 changes: 8 additions & 27 deletions .github/workflows/test-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
contents: write
pages: write
id-token: write
pull-requests: write
Expand All @@ -25,20 +25,11 @@ concurrency:

jobs:
# Single deploy job since we're just deploying
deploy:
deploy-preview:
runs-on: ubuntu-latest
steps:
- name: update PR
if: ${{ github.event_name == 'pull_request' }}
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Started attempt to build a new deploy preview for PR ${{ github.event.pull_request.number }}.
comment_tag: pr_published
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
- name: Set up Node
uses: actions/setup-node@v3
with:
Expand All @@ -47,20 +38,10 @@ jobs:
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Deploy to Server
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
ARGS: "-rlgoDzvc -i --delete"
SOURCE: "dist/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ secrets.REMOTE_TARGET }}${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.event_name == 'push' && 'main' || github.event.inputs.destination}}
- name: update PR
if: ${{ github.event_name == 'pull_request' }}
uses: thollander/actions-comment-pull-request@v2
run: npm run build -- --base=https://momijizukamori.github.io/bookbinder-js/pr-preview/${{ github.event.pull_request.number }}
if: github.event.action != 'closed'
- uses: rossjrw/pr-preview-action@v1
with:
message: |
Created a new deploy preview for PR ${{ github.event.pull_request.number }}. [See preview](https://seam.rip/bookbinder-js/${{ github.event.pull_request.number }}/).
comment_tag: pr_published
source-dir: dist
umbrella-dir: pr-preview
action: auto
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ In the [`/docs`](/docs) directory:
- A basic export of the different layouts with proportional/snug settings have been recorded for comparison/reference as well as several shots of `centered` settings. These can be found in the [`/docs/examples`](/docs/examples) folder.

Snapshot of layout proof summary as of 2022-08-14
![Snapshot of layout proof summary 2022-08-14](/docs/examples_summary_snapshot_2022_08_14.png)
![Snapshot of layout proof summary 2022-08-14](/docs/examples_summary_snapshot_2022_08_14.png)

0 comments on commit 9f5534d

Please sign in to comment.