2024-11-15 23:35:39 +03:00
|
|
|
|
name: "Build and Deploy Test Version (with/without Drafts) - 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-16 00:12:37 +03:00
|
|
|
|
# build-and-push-prod:
|
|
|
|
|
# runs-on: docker
|
|
|
|
|
# container:
|
|
|
|
|
# image: git.asandikci.com/docker-images/website_builder:latest
|
|
|
|
|
# steps:
|
|
|
|
|
# - name: Git Clone
|
|
|
|
|
# run: |
|
|
|
|
|
# git clone https://git.asandikci.com/asandikci.com/web
|
|
|
|
|
# ls -la ./web
|
2024-11-10 23:44:06 +03:00
|
|
|
|
|
2024-11-16 00:12:37 +03:00
|
|
|
|
# - name: Build Site
|
|
|
|
|
# run: |
|
|
|
|
|
# cd web
|
|
|
|
|
# bundle install
|
|
|
|
|
# bundle exec jekyll b
|
|
|
|
|
# env:
|
|
|
|
|
# JEKYLL_ENV: "production"
|
2024-11-13 22:04:46 +03:00
|
|
|
|
|
2024-11-16 00:12:37 +03:00
|
|
|
|
# - name: Push to "website" branch
|
|
|
|
|
# run: |
|
|
|
|
|
# mkdir website_branch && cd website_branch
|
|
|
|
|
# git clone https://git.asandikci.com/asandikci.com/web
|
|
|
|
|
# cd web
|
|
|
|
|
# git checkout website
|
|
|
|
|
# rm -rfv ./_site/
|
|
|
|
|
# cp -rfv ../../web/_site .
|
|
|
|
|
# git config --global user.name "Aliberk Sandıkçı (CI)"
|
|
|
|
|
# git config --global user.email git+ci@asandikci.com
|
|
|
|
|
# git add -A
|
|
|
|
|
# git commit --all --message "Updated! [CI]"
|
|
|
|
|
# git push https://asandikci:${{ secrets.PUSH_KEY }}@git.asandikci.com/asandikci.com/web
|
2024-11-13 23:27:34 +03:00
|
|
|
|
|
2024-11-15 23:35:39 +03:00
|
|
|
|
build-drafts-and-deploy:
|
|
|
|
|
runs-on: docker
|
|
|
|
|
container:
|
|
|
|
|
image: git.asandikci.com/docker-images/website_builder:latest
|
|
|
|
|
steps:
|
|
|
|
|
- name: Git Clone
|
|
|
|
|
run: |
|
|
|
|
|
git clone https://git.asandikci.com/asandikci.com/web
|
|
|
|
|
ls -la ./web
|
|
|
|
|
|
|
|
|
|
- name: Build Site (with Drafts!)
|
|
|
|
|
run: |
|
|
|
|
|
cd web
|
|
|
|
|
bundle install
|
|
|
|
|
bundle exec jekyll b --drafts
|
2024-11-16 00:12:37 +03:00
|
|
|
|
ls -la
|
|
|
|
|
pwd
|
2024-11-15 23:35:39 +03:00
|
|
|
|
env:
|
|
|
|
|
JEKYLL_ENV: "production"
|
|
|
|
|
|
|
|
|
|
# TODO: WILL BE FIXED
|
|
|
|
|
# - name: Test Site
|
|
|
|
|
# run: |
|
|
|
|
|
# cd web
|
|
|
|
|
# bundle exec htmlproofer _site \
|
|
|
|
|
# \-\-disable-external \
|
|
|
|
|
# \-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"
|
|
|
|
|
|
2024-11-16 00:08:08 +03:00
|
|
|
|
- name: Deploy
|
2024-11-13 22:10:36 +03:00
|
|
|
|
run: |
|
2024-11-16 00:12:37 +03:00
|
|
|
|
mkdir deploy && cd deploy
|
|
|
|
|
ls -la
|
|
|
|
|
pwd
|
2024-11-16 00:08:08 +03:00
|
|
|
|
cp -rfv ../web/_site .
|
|
|
|
|
ls -la
|
|
|
|
|
|
2024-11-16 00:20:35 +03:00
|
|
|
|
lftp -c "set sftp:auto-confirm yes; set sftp:connect-program \"ssh -a -x -o UserKnownHostsFile=/dev/null\"; open --user ${{ secrets.SFTP_USERNAME }} --password ${{ secrets.SFTP_PASSWORD }}sftp://${{ vars.SFTP_HOST }}; rm -r www/; mirror -R . www/; quit"
|
2024-11-16 00:08:08 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 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 }} << !
|
|
|
|
|
# rm www/*
|
|
|
|
|
# put -r . www/
|
|
|
|
|
# bye
|
|
|
|
|
# !
|