guibranco / guibranco.github.io

💻 🤓 GuiBranco GitHub Pages
https://guibranco.github.io/
MIT License
2 stars 0 forks source link

[FEATURE] Automate experience table updates from Readme repository #112

Closed guibranco closed 2 weeks ago

guibranco commented 1 year ago

Description

We need to create a GitHub Actions workflow to automate the process of updating the experience table using data from a JSON file in the readme repository. This workflow will download the JSON file, execute a JavaScript file to process the data, replace the content in index.html, commit the changes, and deploy the updated content.

Problem Statement

Proposed Solution

Implementation Steps

  1. Define the Workflow File:

    • Create a new GitHub Actions workflow file (e.g., .github/workflows/update-experience.yml).
  2. Download JSON File:

    • Use a step to download the JSON file from the readme repository. This can be achieved using curl or wget.
    - name: Download Experience JSON
     run: curl -O https://example.com/path/to/experience.json
  3. Run JavaScript File:

    • Add a step to run the JavaScript file that processes the downloaded JSON file. Ensure Node.js is installed and available.
    - name: Run Data Processing Script
     run: node path/to/process-experience.js
  4. Update index.html:

    • Use a step to replace the content in index.html with the updated data. This might involve using a custom script or a tool to inject the processed data.
    - name: Update HTML Content
     run: node path/to/update-index-html.js
  5. Commit and Push Changes:

    • Add steps to commit the changes to index.html and push them back to the repository.
    - name: Commit Changes
     run: |
       git config --global user.name 'github-actions'
       git config --global user.email 'actions@github.com'
       git add index.html
       git commit -m 'Update experience table'
       git push
  6. Deploy Updated Content:

    • Add a step to deploy the updated content to the relevant environment (e.g., using a deployment action or script).
    - name: Deploy Updated Content
     run: ./deploy-script.sh
  7. Testing:

    • Test the workflow to ensure that each step executes correctly and that the experience table is updated as expected.
  8. Documentation:

    • Document the workflow, including the purpose of each step, how to configure it, and any prerequisites or dependencies.

Additional Notes

gitauto-ai[bot] commented 3 months ago

@guibranco Pull request completed! Check it out here https://github.com/guibranco/guibranco.github.io/pull/188 🚀

Note: I automatically create a pull request for an unassigned and open issue in order from oldest to newest once a day at 00:00 UTC, as long as you have remaining automation usage. Should you have any questions or wish to change settings or limits, please feel free to contact info@gitauto.ai or invite us to Slack Connect.