Skip to content

Merge pull request #49 from oujonny/development #45

Merge pull request #49 from oujonny/development

Merge pull request #49 from oujonny/development #45

Workflow file for this run

# Sample workflow for building and deploying a Hugo site to GitHub Pages
name: Deploy to schley.ch
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
# Default to bash
defaults:
run:
shell: bash
jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.105.0
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Deploy with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo --minify --noBuildLock
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: public
path: ./public
# Deployment job
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: public
path: ./public
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
name: id_rsa
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: deploy
env:
SSH_USER: "toxykiwo"
HOST: "s106.cyon.net"
DIR: "public_html/schley.ch/"
run: |
rsync -avz --delete public/ ${SSH_USER}@${HOST}:~/${DIR}