This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
π Update WeCode stuff and Number of exercises #55
This file contains 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
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 at $(TZ="Asia/Bangkok" date "+%d-%m-%y at %I:%M %p")" | |
git push | |
else | |
echo "Nothing to commit" | |
fi |