Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

πŸ“ (2-167-func-H-N): Add space #42

πŸ“ (2-167-func-H-N): Add space

πŸ“ (2-167-func-H-N): Add space #42

name: Github Page build for Organisation
on:
push:
branches:
- main
- dev
workflow_dispatch:
env:
USERNAME: ${{ vars.ACTION_RUNNER_USERNAME }}
EMAIL: ${{ vars.ACTION_RUNNER_EMAIL }}
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
permissions: write-all
jobs:
page:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Setup user
run: |
if [ -n "${{ env.EMAIL }}" ]; then
git config --global user.email ${{ env.EMAIL }}
else
git config --global user.email "[email protected]"
fi
if [ -n "${{ env.USERNAME }}" ]; then
git config --global user.name ${{ env.USERNAME }}
else
git config --global user.name "GitHub Action"
fi
- name: Setup NMLT NTTMK K18 repo
run: scripts/githubPageSetup.sh ${{ secrets.USER_GITHUB_TOKEN }}
- name: Commit and push if changed
working-directory: Github-Page-Repo
run: |
if ! git status | grep "nothing to commit" > /dev/null 2>&1; then
git add .
git commit -m "Update github page folder at $(TZ="Asia/Bangkok" date "+%d-%m-%y at %I:%M %p")"
git push
else
echo "Nothing to commit"
fi