2024-11-13 21:38:23 +03:00
|
|
|
name: "Build and Deploy Test Version - next.asandikci.com"
|
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:
|
2024-11-13 22:10:36 +03:00
|
|
|
build_deploy:
|
2024-10-30 01:55:10 +03:00
|
|
|
runs-on: docker
|
2024-11-11 23:31:10 +03:00
|
|
|
container:
|
2024-11-12 00:50:23 +03:00
|
|
|
image: bitnami/minideb:bookworm-arm64
|
2024-11-11 22:04:22 +03:00
|
|
|
steps:
|
2024-11-12 00:50:23 +03:00
|
|
|
- name: Setup System Resources & Settings
|
|
|
|
run: |
|
2024-11-13 21:30:48 +03:00
|
|
|
apt-get update -y
|
|
|
|
apt-get upgrade -y
|
2024-11-13 22:10:54 +03:00
|
|
|
apt-get install git sshpass ruby-dev build-essential jekyll -y
|
2024-11-12 00:50:23 +03:00
|
|
|
# no need to these after using own docker image! (see asandikci/DockerTests)
|
2024-11-10 23:38:20 +03:00
|
|
|
|
2024-11-12 00:52:44 +03:00
|
|
|
- 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
|
|
|
|
!
|
2024-11-11 23:09:48 +03:00
|
|
|
|
2024-11-13 22:04:46 +03:00
|
|
|
- name: Git Clone
|
2024-11-13 21:27:27 +03:00
|
|
|
run: |
|
|
|
|
git clone https://git.asandikci.com/asandikci.com/web
|
2024-11-13 21:33:36 +03:00
|
|
|
ls -la ./web
|
2024-11-10 23:44:06 +03:00
|
|
|
|
2024-11-12 00:50:23 +03:00
|
|
|
- name: Build Site
|
|
|
|
run: |
|
|
|
|
ruby -v
|
2024-11-13 21:33:36 +03:00
|
|
|
cd web
|
2024-11-12 00:50:23 +03:00
|
|
|
bundle install
|
|
|
|
bundle exec jekyll b
|
|
|
|
env:
|
2024-11-13 22:04:46 +03:00
|
|
|
JEKYLL_ENV: "production"
|
|
|
|
|
|
|
|
- name: Push to "website" branch
|
|
|
|
run: |
|
|
|
|
echo "do not ready yet"
|
2024-11-13 22:10:36 +03:00
|
|
|
|
|
|
|
- name: Checkout & Deploy
|
|
|
|
run: |
|
2024-11-13 22:15:36 +03:00
|
|
|
mkdir deploy && cd deploy
|
2024-11-13 22:10:36 +03:00
|
|
|
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
|
|
|
|
!
|
2024-11-13 22:04:46 +03:00
|
|
|
|
|
|
|
|
2024-11-11 22:04:22 +03:00
|
|
|
|
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:
|
2024-11-13 22:10:36 +03:00
|
|
|
# path: "_site${{ steps.pages.outputs.base_path }}"
|