← BackAutomatically update data and commitu11g.com
11/25/2021

Automatically update data and commit

My Workflow

I just wrote an article about Github Actions, but I don’t want to deprive you of this one! What is it about? For a single page application, various data sources are tapped. However, some data cannot be loaded directly from the application. For this reason I wrote a script that pulls, aggregates and formats the data. In order for the data to be delivered with the application it must be committed into the repo. Then the regular CI pipeline runs, which builds and publishes the app: The nice thing is that I don’t have to do anything else, because the Github action runs itself on a regular basis, and every time it commits to the main branch, the CI pipeline runs. The application was about getting a POC up and running quickly to tap into data from various sources and prepare it accordingly. The Github workflow consists of three main parts:

  1. Setup
  2. Execute script
  3. Commit and push
name: Update Polls and Execs 
on: 
  schedule: 
    - cron: "5 18 * * 1" 
jobs: 
  resources: 
    name: Update Polls and Execs 
    runs-on: ubuntu-latest 
    steps: 
      - uses: actions/checkout@v1 
      - uses: actions/setup-node@v1 
        with: 
          node-version: 14 
      - run: npm install 
      - name: Run script to update data 
        run: npm run index 
      - name: Push data 
        uses: test-room-7/action-update-file@v1 
        with: 
          file-path: | 
            src/app/constants/polls.constants.ts 
            src/app/constants/proposals.constants.ts 
          commit-msg: chore(data) update polls and execs 
          github-token: ${{ secrets.GITHUB_TOKEN }}

The exciting thing about this action is the scheduled execution. Not everyone may be aware of this, but it can be used to map cron jobs that do their regular work.

Additional Resources / Info

Have fun!

Home
Projects
Newsletter
Blog
Me
Philosophy
Gen Art
Work
Setup
CV
Machine
Dynamic Pong: Territory Conquest Meets Classic Physics
Introducing Camunda Directory
Getting Started with AIME Directory Collections in 5 Minutes
How to use a proxy in a nodejs environment
Introducing weeklyfoo
Create your own epaper calendar with Canvas
Codespaces can become a game changer
Cloudflare pages direct upload with stable preview urls
Building your own Twitter Thread Generator
300 APIs integrated in minutes, not days
Be an orchestration hero
Cut a few braids - new NPM package
ETHme - your chic web3 identity
Automatically update data and commit
Aren't the standard actions going too far for you? Write your own one!
Screenshots - a perfect task to automate!
Send messages to Slack from Camunda Cloud
5 Steps how to track your Team's Mood
Automate your manual tasks with Camunda and Trello!
Go beyond the basics
Is there an alternative to spaghetti?
Play with node-canvas and build something useful
How do I implement a command line tool?
Aime Directory
Boring Dev Tools
Camunda Directory
Data Democracy
Dev Pulse
Dynamic Pong
Lifosy
Art u11g
dapphuntr
DiyPunks
flethy
Maker Oracles
SwagTime
EthME
fcheat
Find the next victim
Generative Arts
MakerDAO Delegates
SkunkWorks NFT
Trees of Life NFT
zukuNFT
RestZeebe
Websiteshot
Zeebetron: How to Manage Multiple Zeebe Profiles with Electron
dot calendar
Sharu
Switch Interface (theme)
LINKEDIN
X
GITHUB