Daily sync #749
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
# This is a basic workflow to help you get started with Actions | |
name: Daily sync | |
# Controls when the workflow will run | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Triggers the workflow daily | |
schedule: | |
- cron: "0 0 * * *" | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3.5.0 | |
with: | |
node-version: 16 | |
- name: Run Git Configurations | |
run: | | |
git config --local user.name "Github Action Runner" | |
git config --local user.email "github-action-runner@example.com" | |
- name: Execute version update | |
run: | | |
cd automation | |
npm install | |
npm run start | |
- name: Push version to Github | |
id: github-push | |
run: | | |
git add . | |
git diff-index --quiet HEAD || git commit -m "sync" | |
git push | |
- name: Failed to push version | |
if: ${{ failure() && steps.github-push.conclusion == 'failure' }} | |
run: echo Failed to update version or version already at latest |