an automated quick commit and push (tpush) #11
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: Deploy to t-ibrahimm.github.io | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the t-website repository | |
- name: Checkout t-website repository | |
uses: actions/checkout@v2 | |
# Step 2: Checkout the t-ibrahimm.github.io repository into the 'deploy' directory | |
- name: Checkout t-ibrahimm.github.io repository | |
uses: actions/checkout@v2 | |
with: | |
repository: t-ibrahimm/t-ibrahimm.github.io | |
token: ${{ secrets.TARGET_REPO_TOKEN }} | |
path: deploy | |
# Step 3: Copy all files from t-website to the 'deploy' directory, excluding the 'deploy' directory itself | |
- name: Copy files | |
run: cp -r $(ls -A | grep -v deploy) deploy/ | |
# Step 4: Configure Git user, commit, and push changes | |
- name: Commit and push changes | |
run: | | |
cd deploy | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add . | |
git diff-index --quiet HEAD || git commit -m "Update from t-website" | |
git push origin master | |
# Step 5: Install dependencies and deploy | |
- name: Install dependencies and deploy | |
run: | | |
cd deploy | |
yarn install | |
yarn deploy |