Skip to content

fix(ci): transfer folder and not just files #223

fix(ci): transfer folder and not just files

fix(ci): transfer folder and not just files #223

Workflow file for this run

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Build and deploy pages
on:
push:
branches: [ main ]
paths-ignore:
- README.md
- .gitignore
- _config.dev.yml
- 'bin/**'
- 'scaffolds/**'
- 'workflows/**'
- 'source/_drafts/**'
jobs:
build:
runs-on: ubuntu-latest
environment:
name: production
url: https://thom4.net
steps:
# Setup
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- run: npm ci
# Build
- run: npm run build
env:
NODE_ENV: production
# Deploy
# - name: Install mc
# run: |
# wget --quiet https://dl.min.io/client/mc/release/linux-amd64/mc
# chmod +x mc
# - name: Setup mc
# run: ./mc alias set deuxfleurs https://garage.deuxfleurs.fr "${{ secrets.MINIO_ACCESS_KEY_ID }}" ${{ secrets.MINIO_SECRET_ACCESS_KEY }} --api S3v4
# - name: Transfer
# if: ${{ contains(github.event.head_commit.message, '[deploy]') }}
# run: ./mc mirror --preserve --overwrite --exclude 'talks/*' --exclude 'photography/*' --summary --quiet ./public/ deuxfleurs/thom4.net/
- name: Setup SSH
uses: shimataro/ssh-key-action@v2
with:
key: "${{ secrets.SSH_PRIVATE_KEY }}"
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
- name: Transfer
run: rsync --compress --archive --stats --delete --exclude 'photography/*' --exclude 'talks/*' ./public/ oncletom@${{ secrets.SSH_HOST }}:./
# Index content
- name: Index content on Algolia
run: ./node_modules/.bin/hexo algolia --layouts page,reading-note --config _config.yml --indexing-key ${{ secrets.HEXO_ALGOLIA_INDEXING_KEY }}