67 lines
1.7 KiB
YAML
67 lines
1.7 KiB
YAML
name: "Build & Publish"
|
|
|
|
on: [push]
|
|
|
|
concurrency:
|
|
group: build-publish
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build:
|
|
name: "Build"
|
|
runs-on: "ubuntu-22.04"
|
|
strategy:
|
|
fail-fast: true
|
|
steps:
|
|
- name: "Install Build Tools"
|
|
shell: bash
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install ruby-full build-essential zlib1g-dev
|
|
echo "GEM_HOME=$HOME/gems" >> "${GITHUB_ENV}"
|
|
echo "PATH=$HOME/bin:$PATH" >> "${GITHUB_ENV}"
|
|
sudo gem install bundler
|
|
- name: "Clone"
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
fetch-depth: 0
|
|
- name: "Install Dependencies"
|
|
shell: bash
|
|
run: |
|
|
bundle install
|
|
- name: "Build"
|
|
shell: bash
|
|
run: |
|
|
bundle exec jekyll clean --destination build
|
|
bundle exec jekyll build --destination build
|
|
- name: "Upload Artifact"
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
path: "build/"
|
|
if-no-files-found: error
|
|
retention-days: 7
|
|
compression-level: 0
|
|
publish:
|
|
name: "Publish"
|
|
runs-on: "ubuntu-22.04"
|
|
needs: build
|
|
strategy:
|
|
fail-fast: true
|
|
steps:
|
|
- name: "Download Artifact"
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
merge-multiple: true
|
|
- name: "Restore SSH Key"
|
|
shell: bash
|
|
run: |
|
|
mkdir $HOME/.ssh
|
|
echo "${{ secrets.SSHKEY }}" | base64 -d > $HOME/.ssh/id_ed25519
|
|
echo "Host xaymar.com" >> $HOME/.ssh/config
|
|
echo " StrictHostKeyChecking no" >> $HOME/.ssh/config
|
|
- name: "Publish"
|
|
shell: bash
|
|
run: |
|
|
rsync -v -h -P -a --delete . "com.xaymar@xaymar.com:/var/www/com.xaymar/public/com.xaymar.www/"
|