Update GitHub Actions workflow #24
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: Build and deploy to GitHub Pages | |
on: | |
push: | |
branches: [main] | |
schedule: | |
- cron: '0 0 */7 * *' | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v2.3.1 | |
- name: Install and Build 🔧 | |
run: | | |
npm ci | |
npm run build | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@4.1.0 | |
with: | |
branch: gh-pages | |
folder: dist | |
commit: | |
name: Commit changes | |
runs-on: ubuntu-latest | |
if: github.event_name == 'schedule' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Make a change to update_log.txt | |
run: | | |
echo "Update on $(date)" > update_log.txt | |
- name: Configure Git user | |
run: | | |
git config --global user.name 'Iryna Vyshniak' | |
git config --global user.email 'iryna.vyshniak@gmail.com' | |
- name: Commit changes | |
run: | | |
git add update_log.txt | |
git commit -m "Update deploy" | |
git push |