Better grid styles for blogcards container #28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| name: Deploy to github pages | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '21.x' | |
| cache: "npm" | |
| - run: sudo apt-get install sshpass | |
| - uses: webfactory/[email protected] | |
| with: | |
| ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| - uses: actions/cache@v3 | |
| env: | |
| cache-name: cache-node-modules | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - run: npm ci | |
| - run: npm run build | |
| - env: | |
| SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }} | |
| run: | | |
| mkdir /tmp/remote_dist | |
| cd /tmp/remote_dist | |
| git config --global user.name 'Taha ibn Munawar' | |
| git config --global user.email '[email protected]' | |
| sshpass -v -P "Enter passphrase for key" -p $SSH_PASSWORD git clone [email protected]:mutawwir-blog/mutawwir-blog.github.io ./ | |
| ls -A | awk '!/^\.git.*$/ { print $0 }' | while read line; do rm -rf ./$line; done | |
| # Copying contents of parent into child, without copying the child itself too | |
| cp -r ~/work/mutawwir-blog/mutawwir-blog/dist/* ./ | |
| touch .nojekyll | |
| if [[ -n $(git status -s) ]]; then | |
| git add . | |
| git commit -m "updated from github action workflow" | |
| sshpass -v -P "Enter passphrase for key" -p $SSH_PASSWORD git push | |
| else | |
| echo nothing to be commited, exiting | |
| fi | |