
Some checks failed
Build and deploy website / Build and Push Jekyll Site (push) Failing after 4s
59 lines
1.5 KiB
YAML
59 lines
1.5 KiB
YAML
name: "Build and deploy website"
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- .gitignore
|
|
- README.md
|
|
- LICENSE
|
|
|
|
# Allow one concurrent deployment
|
|
concurrency:
|
|
group: "blog"
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-push:
|
|
name: Build and Push Jekyll Site
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
# submodules: true
|
|
# If using the 'assets' git submodule from Chirpy Starter, uncomment above
|
|
# (See: https://github.com/cotes2020/chirpy-starter/tree/main/assets)
|
|
|
|
# Build and test site
|
|
|
|
- name: Setup Ruby
|
|
uses: https://github.com/ruby/setup-ruby@v1
|
|
with:
|
|
ruby-version: 3.3
|
|
bundler-cache: true
|
|
|
|
- name: Build site
|
|
run: bundle exec jekyll b -d _site
|
|
env:
|
|
JEKYLL_ENV: "production"
|
|
|
|
- name: Test site
|
|
run: |
|
|
bundle exec htmlproofer _site \
|
|
\-\-disable-external \
|
|
\-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"
|
|
|
|
- name: Copy website to destination server
|
|
uses: garygrossgarten/github-action-scp@release
|
|
with:
|
|
local: _site
|
|
remote: /srv/docker/nginx/html/blog
|
|
host: ${{ secrets.SSH_HOST }}
|
|
port: ${{ secrets.SSH_PORT }}
|
|
username: ${{ secrets.SSH_USER }}
|
|
privateKey: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
rmRemote: true
|