Update CI
- Both build with/without drafts - publish to website branch without-draft build - deploy to actual website with-draft-build - remove _site directory while publishing to website branch to prevent caching/collisions - remove files in www/ directory in actual website to prevent caching/collisions
This commit is contained in:
parent
771c31cf6c
commit
99dd009236
1 changed files with 31 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
||||||
name: "Build and Deploy Test Version (with Drafts!) - next.asandikci.com"
|
name: "Build and Deploy Test Version (with/without Drafts) - next.asandikci.com"
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
@ -20,7 +20,7 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_deploy:
|
build-and-push-prod:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: git.asandikci.com/docker-images/website_builder:latest
|
image: git.asandikci.com/docker-images/website_builder:latest
|
||||||
|
@ -34,16 +34,9 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
cd web
|
cd web
|
||||||
bundle install
|
bundle install
|
||||||
bundle exec jekyll b --drafts
|
bundle exec jekyll b
|
||||||
env:
|
env:
|
||||||
JEKYLL_ENV: "production"
|
JEKYLL_ENV: "production"
|
||||||
|
|
||||||
- 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/"
|
|
||||||
|
|
||||||
- name: Push to "website" branch
|
- name: Push to "website" branch
|
||||||
run: |
|
run: |
|
||||||
|
@ -51,6 +44,7 @@ jobs:
|
||||||
git clone https://git.asandikci.com/asandikci.com/web
|
git clone https://git.asandikci.com/asandikci.com/web
|
||||||
cd web
|
cd web
|
||||||
git checkout website
|
git checkout website
|
||||||
|
rm -rfv ./_site/
|
||||||
cp -rfv ../../web/_site .
|
cp -rfv ../../web/_site .
|
||||||
git config --global user.name "Aliberk Sandıkçı (CI)"
|
git config --global user.name "Aliberk Sandıkçı (CI)"
|
||||||
git config --global user.email git+ci@asandikci.com
|
git config --global user.email git+ci@asandikci.com
|
||||||
|
@ -58,6 +52,32 @@ jobs:
|
||||||
git commit --all --message "Updated! [CI]"
|
git commit --all --message "Updated! [CI]"
|
||||||
git push https://asandikci:${{ secrets.PUSH_KEY }}@git.asandikci.com/asandikci.com/web
|
git push https://asandikci:${{ secrets.PUSH_KEY }}@git.asandikci.com/asandikci.com/web
|
||||||
|
|
||||||
|
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
|
||||||
|
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/"
|
||||||
|
|
||||||
- name: Checkout & Deploy
|
- name: Checkout & Deploy
|
||||||
run: |
|
run: |
|
||||||
mkdir deploy && cd deploy
|
mkdir deploy && cd deploy
|
||||||
|
@ -68,6 +88,7 @@ jobs:
|
||||||
echo '${{ secrets.SFTP_PASSWORD }}' > ~/.passwd
|
echo '${{ secrets.SFTP_PASSWORD }}' > ~/.passwd
|
||||||
chmod 0400 ~/.passwd
|
chmod 0400 ~/.passwd
|
||||||
sshpass -f ~/.passwd sftp -oBatchMode=no -o StrictHostKeyChecking=accept-new -b - ${{ secrets.SFTP_USERNAME }}@${{ vars.SFTP_HOST }} << !
|
sshpass -f ~/.passwd sftp -oBatchMode=no -o StrictHostKeyChecking=accept-new -b - ${{ secrets.SFTP_USERNAME }}@${{ vars.SFTP_HOST }} << !
|
||||||
|
rm www/*
|
||||||
put -r . www/
|
put -r . www/
|
||||||
bye
|
bye
|
||||||
!
|
!
|
Loading…
Reference in a new issue