2022-09-24 20:58:54 +03:00
|
|
|
name: "Build and Deploy"
|
2020-07-28 21:27:40 +03:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2022-08-14 00:47:30 +03:00
|
|
|
- main
|
2020-07-28 21:27:40 +03:00
|
|
|
paths-ignore:
|
2020-10-03 11:45:17 +03:00
|
|
|
- .gitignore
|
|
|
|
- README.md
|
|
|
|
- LICENSE
|
2022-08-14 00:47:30 +03:00
|
|
|
workflow_dispatch:
|
2020-07-28 21:27:40 +03:00
|
|
|
|
2022-08-14 00:47:30 +03:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pages: write
|
|
|
|
id-token: write
|
|
|
|
|
|
|
|
# Allow one concurrent deployment
|
|
|
|
concurrency:
|
|
|
|
group: "pages"
|
|
|
|
cancel-in-progress: true
|
2020-10-07 18:53:05 +03:00
|
|
|
|
2022-08-14 00:47:30 +03:00
|
|
|
jobs:
|
|
|
|
build:
|
2024-10-30 01:55:10 +03:00
|
|
|
runs-on: docker
|
2024-11-11 22:04:22 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Setup SFTP & Ruby
|
|
|
|
run: |
|
|
|
|
apt update -y
|
|
|
|
apt upgrade -y
|
2024-11-11 22:21:40 +03:00
|
|
|
apt install sshpass -y # openssh-client ruby jekyll
|
2024-11-10 23:38:20 +03:00
|
|
|
|
2024-11-11 22:04:22 +03:00
|
|
|
- name: Health Check [CI TEST]
|
2024-11-10 23:44:06 +03:00
|
|
|
run: |
|
|
|
|
ls -la
|
|
|
|
pwd
|
|
|
|
whoami
|
2024-11-11 22:04:22 +03:00
|
|
|
echo "this is a text file" >> index.html
|
|
|
|
date >> index.html
|
2024-11-11 22:09:43 +03:00
|
|
|
cat index.html
|
2024-11-11 22:17:12 +03:00
|
|
|
echo '${{ secrets.SFTP_PASSWORD }}' > ~/.passwd
|
|
|
|
chmod 0400 ~/.passwd
|
2024-11-11 22:20:02 +03:00
|
|
|
sshpass -f ~/.passwd sftp -oBatchMode=no -o StrictHostKeyChecking=accept-new -b - ${{ secrets.SFTP_USERNAME }}@${{ vars.SFTP_HOST }} << !
|
2024-11-11 22:04:22 +03:00
|
|
|
put index.html www/index.html
|
|
|
|
bye
|
|
|
|
!
|
2024-11-11 22:13:32 +03:00
|
|
|
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
github-server-url: 'https://git.asandikci.com'
|
|
|
|
# submodules: true
|
|
|
|
# If using the 'assets' git submodule from Chirpy Starter, uncomment above
|
|
|
|
# (See: https://github.com/cotes2020/chirpy-starter/tree/main/assets)
|
2024-11-10 23:44:06 +03:00
|
|
|
|
2024-11-11 22:04:22 +03:00
|
|
|
- name: Build Site
|
|
|
|
run: bundle exec jekyll b
|
|
|
|
env:
|
|
|
|
JEKYLL_ENV: "production"
|
|
|
|
|
2024-11-10 23:35:34 +03:00
|
|
|
|
2024-10-30 01:55:10 +03:00
|
|
|
# - name: Setup Pages
|
|
|
|
# id: pages
|
|
|
|
# uses: actions/configure-pages@v4
|
2020-11-22 20:26:29 +03:00
|
|
|
|
2024-10-30 01:55:10 +03:00
|
|
|
# - name: Setup Ruby
|
|
|
|
# uses: ruby/setup-ruby@v1
|
|
|
|
# with:
|
|
|
|
# ruby-version: 3.2
|
|
|
|
# bundler-cache: true
|
2020-07-28 21:27:40 +03:00
|
|
|
|
2024-10-30 01:55:10 +03:00
|
|
|
# - name: Build site
|
|
|
|
# run: bundle exec jekyll b -d "_site${{ steps.pages.outputs.base_path }}"
|
|
|
|
# env:
|
|
|
|
# JEKYLL_ENV: "production"
|
2022-08-14 00:47:30 +03:00
|
|
|
|
2024-10-30 01:55:10 +03:00
|
|
|
# - name: Test site
|
|
|
|
# run: |
|
|
|
|
# bundle exec htmlproofer _site \
|
|
|
|
# \-\-disable-external=true \
|
|
|
|
# \-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"
|
2022-08-14 00:47:30 +03:00
|
|
|
|
2024-10-30 01:55:10 +03:00
|
|
|
# - name: Upload site artifact
|
|
|
|
# uses: actions/upload-pages-artifact@v3
|
|
|
|
# with:
|
|
|
|
# path: "_site${{ steps.pages.outputs.base_path }}"
|
2022-08-14 00:47:30 +03:00
|
|
|
|
2024-10-30 01:56:49 +03:00
|
|
|
# deploy:
|
|
|
|
# environment:
|
|
|
|
# name: github-pages
|
|
|
|
# url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
# needs: build
|
|
|
|
# steps:
|
|
|
|
# - name: Deploy to GitHub Pages
|
|
|
|
# id: deployment
|
|
|
|
# uses: actions/deploy-pages@v4
|