feat: blog setup #52
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 | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Build deps | |
run: yarn | |
- name: Build the website | |
run: yarn build | |
- if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
name: Deploy website | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
folder: dist | |
target-folder: . | |
- name: Add .nojekyll | |
run: | | |
mkdir extra/ | |
touch extra/.nojekyll | |
- if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
name: Deploy .nojekyll | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
folder: dist | |
clean: false | |
- if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
name: Deploy to cmu server | |
uses: easingthemes/ssh-deploy@main | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.CMU_SSH_PRIVATE_KEY }} | |
ARGS: "-rlgoDzvc -i" | |
SOURCE: "dist/" | |
REMOTE_HOST: ${{ secrets.CMU_HOST }} | |
REMOTE_USER: ${{ secrets.CMU_USER }} | |
TARGET: ${{ secrets.CMU_TARGET }} | |
SCRIPT_BEFORE: | | |
whoami | |
ls -al | |
SCRIPT_AFTER: | | |
whoami | |
ls -al | |
echo $RSYNC_STDOUT |