-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
32 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,40 @@ | ||
name: Deploy React to GitHub Pages | ||
name: Update Dependencies | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # name of the branch you are pushing to | ||
schedule: | ||
- cron: '0 0 * * 0' # This runs every Sunday at midnight UTC | ||
workflow_dispatch: # This allows manual triggering | ||
|
||
jobs: | ||
build: | ||
update: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '22' | ||
- name: Install Dependencies | ||
run: npm ci | ||
- name: Build | ||
run: npm run build | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
path: 'build/.' | ||
deploy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: 'https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/' | ||
steps: | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v5 | ||
- name: Deploy | ||
uses: actions/deploy-pages@v4 | ||
node-version: '16' # Specify the Node.js version you want | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Update packages | ||
run: | | ||
npm install -g npm-check-updates | ||
ncu -u # This updates package.json with new versions | ||
npm install # Install the updated packages | ||
- name: Commit changes | ||
run: | | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git add package.json package-lock.json | ||
git commit -m "ci: update dependencies" || echo "No changes to commit" | ||
- name: Push changes | ||
run: git push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |