Dependency Update Check #26
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: Dependency Update Check | |
on: | |
schedule: | |
- cron: "0 0 */3 * *" | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
dependency-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Dependencies | |
run: npm install --global yarn | |
- name: Install Project Dependencies | |
run: yarn install | |
- name: Update Dependencies | |
run: yarn up "*" | |
- name: Build Project | |
run: CI=false yarn build | |
- name: Commit Dependency Changes | |
run: | | |
# Set up git configuration | |
git config --global user.name "Eric Idogun" | |
git config --global user.email "[email protected]" | |
# Ensure you're on the main branch and commit dependency updates | |
git checkout main | |
git add . | |
git commit -m "chore: update dependencies" || echo "No changes to commit." | |
git push origin main | |
- name: Deploy to gh-pages branch | |
run: | | |
# Switch to gh-pages branch | |
git checkout -B gh-pages | |
# Enable extended globbing | |
shopt -s extglob | |
# Remove everything except the build folder | |
rm -rf !(build) | |
# Copy the build contents to the root directory | |
cp -R build/* . | |
# Add CNAME file with custom domain | |
echo "tegaidogun.dev" > CNAME | |
# Commit the changes and deploy | |
git add . -f | |
git commit -m "chore: deploy website" || echo "No changes to commit." | |
git push --force origin gh-pages |