From b1d2112bbb6ff3372e842b363beb2d7ad400e2ee Mon Sep 17 00:00:00 2001 From: Iryna-Vyshniak Date: Sun, 14 Jul 2024 11:10:00 +0300 Subject: [PATCH] Add deploy .yml --- .github/workflows/deploy.yml | 58 ++++++++++++++++++++++++++++++++++++ update_log.txt | 0 2 files changed, 58 insertions(+) create mode 100644 .github/workflows/deploy.yml create mode 100644 update_log.txt diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..fd48222 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,58 @@ +name: Build and deploy to GitHub Pages + +on: + push: + branches: [main] + schedule: + - cron: '0 0 */5 * *' + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout ๐Ÿ›Ž๏ธ + uses: actions/checkout@v2.3.1 + + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: 16 + + - name: Install dependencies ๐Ÿ”ง + run: npm install + + - name: Lint code ๐Ÿงน + run: npm run lint:js + + - name: Build project ๐Ÿ› ๏ธ + run: npm run web + + - name: Deploy ๐Ÿš€ + uses: JamesIves/github-pages-deploy-action@4.1.0 + with: + branch: gh-pages + folder: web-build + + 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 log" + git push diff --git a/update_log.txt b/update_log.txt new file mode 100644 index 0000000..e69de29