asandikci
c3fe15207b
Some checks failed
Build and Deploy Test Version - next.asandikci.com / build_deploy (push) Has been cancelled
105 lines
No EOL
2.8 KiB
YAML
105 lines
No EOL
2.8 KiB
YAML
name: "Build and Deploy Test Version - next.asandikci.com"
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- .gitignore
|
|
- README.md
|
|
- LICENSE
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
# Allow one concurrent deployment
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build_deploy:
|
|
runs-on: docker
|
|
container:
|
|
image: bitnami/minideb:bookworm-arm64
|
|
steps:
|
|
- name: Setup System Resources & Settings
|
|
run: |
|
|
apt-get update -y
|
|
apt-get upgrade -y
|
|
apt-get install git sshpass ruby-dev build-essential jekyll -y # make zlib1g-dev
|
|
# no need to these after using own docker image! (see asandikci/DockerTests)
|
|
|
|
- name: Health Check [CI TEST]
|
|
run: |
|
|
ls -la
|
|
pwd
|
|
whoami
|
|
echo "this is a text file" >> index.html
|
|
date >> index.html
|
|
cat index.html
|
|
echo '${{ secrets.SFTP_PASSWORD }}' > ~/.passwd
|
|
chmod 0400 ~/.passwd
|
|
sshpass -f ~/.passwd sftp -oBatchMode=no -o StrictHostKeyChecking=accept-new -b - ${{ secrets.SFTP_USERNAME }}@${{ vars.SFTP_HOST }} << !
|
|
put index.html www/index.html
|
|
bye
|
|
!
|
|
|
|
- name: Git Clone
|
|
run: |
|
|
git clone https://git.asandikci.com/asandikci.com/web
|
|
ls -la ./web
|
|
|
|
- name: Build Site
|
|
run: |
|
|
ruby -v
|
|
cd web
|
|
bundle install
|
|
bundle exec jekyll b
|
|
env:
|
|
JEKYLL_ENV: "production"
|
|
|
|
- name: Push to "website" branch
|
|
run: |
|
|
echo "do not ready yet"
|
|
|
|
- name: Checkout & Deploy
|
|
run: |
|
|
git clone https://git.asandikci.com/asandikci.com/web
|
|
cd web
|
|
git checkout website
|
|
sshpass -f ~/.passwd sftp -oBatchMode=no -o StrictHostKeyChecking=accept-new -b - ${{ secrets.SFTP_USERNAME }}@${{ vars.SFTP_HOST }} << !
|
|
put -r . www/
|
|
bye
|
|
!
|
|
|
|
|
|
|
|
|
|
# - name: Setup Pages
|
|
# id: pages
|
|
# uses: actions/configure-pages@v4
|
|
|
|
# - name: Setup Ruby
|
|
# uses: ruby/setup-ruby@v1
|
|
# with:
|
|
# ruby-version: 3.2
|
|
# bundler-cache: true
|
|
|
|
# - name: Build site
|
|
# run: bundle exec jekyll b -d "_site${{ steps.pages.outputs.base_path }}"
|
|
# env:
|
|
# JEKYLL_ENV: "production"
|
|
|
|
# - 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/"
|
|
|
|
# - name: Upload site artifact
|
|
# uses: actions/upload-pages-artifact@v3
|
|
# with:
|
|
# path: "_site${{ steps.pages.outputs.base_path }}" |