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-15 18:48:01 +03:00
|
|
|
|
image: git.asandikci.com/docker-images/website_builder:latest
|
|
|
|
|
steps:
|
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
|
2024-11-13 23:07:06 +03:00
|
|
|
|
ls -la
|
2024-11-12 00:50:23 +03:00
|
|
|
|
env:
|
2024-11-13 22:04:46 +03:00
|
|
|
|
JEKYLL_ENV: "production"
|
|
|
|
|
|
|
|
|
|
- name: Push to "website" branch
|
|
|
|
|
run: |
|
2024-11-13 23:27:34 +03:00
|
|
|
|
mkdir website_branch && cd website_branch
|
|
|
|
|
git clone https://git.asandikci.com/asandikci.com/web
|
|
|
|
|
cd web
|
|
|
|
|
git checkout website
|
2024-11-15 17:38:59 +03:00
|
|
|
|
cp -rfv ../../web/_site .
|
2024-11-13 23:39:10 +03:00
|
|
|
|
git config --global user.name "Aliberk Sandıkçı (CI)"
|
|
|
|
|
git config --global user.email git+ci@asandikci.com
|
2024-11-13 23:27:34 +03:00
|
|
|
|
git add -A
|
2024-11-13 23:39:10 +03:00
|
|
|
|
git commit --all --message "built latest static sources from main"
|
2024-11-13 23:27:34 +03:00
|
|
|
|
git push https://asandikci:${{ secrets.PUSH_KEY }}@git.asandikci.com/asandikci.com/web --all
|
|
|
|
|
|
|
|
|
|
|
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
|
2024-11-13 22:24:46 +03:00
|
|
|
|
cd _site
|
2024-11-13 22:10:36 +03:00
|
|
|
|
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 }}"
|