Code Monkey home page Code Monkey logo

rebuildaction's Introduction

RebuildAction

A GitHub Action + GitLab CI pipeline for rebuilding content.

Setup

First, import your project into JuliaGPU on GitLab as described here.

Next, add a .gitlab-ci.yml file to your repository with the following contents:

include: https://raw.githubusercontent.com/SciML/RebuildAction/master/rebuild.yml
variables:
  CONTENT_DIR: mycontent  # Directory holding your source content.
  GITHUB_REPOSITORY: Owner/Repo  # GitHub user/repository name (no .git).
  # The following are optional.
  JULIA_PACKAGE: Repo  # Name of the Julia package if your package and repo names are different.
  EXCLUDE: folder/file1, folder/file2  # Content to not rebuild automatically.
  NEEDS_GPU: folder/file1, folder/file2  # Content that needs a GPU to build.
  GPU_TAG: gpu  # Tag added to GPU jobs (default is 'nvidia').
  TAGS: tag1, tag2  # Tags to add to all rebuild jobs.

Now, add a .github/workflows/rebuild.yml file with the following contents:

name: Rebuild Content
on:
  schedule:
    - cron: 0 0 */3 * *
  issue_comment:
    types:
      - created
  push:
env:
  GITLAB_PROJECT: ${{ secrets.GITLAB_PROJECT }}
  GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
jobs:
  Rebuild:
    runs-on: ubuntu-latest
    steps:
      - uses: SciML/RebuildAction@master
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

Next, generate an SSH key pair with ssh-keygen. Add the public key as a deploy key with write permissions to your GitHub repo. Then, add the private key as a File environment variable with the name SSH_KEY in GitLab.

Now, find your GitLab project ID and add it as a GitHub secret called GITLAB_PROJECT.

Then create a Gitlab pipeline trigger and add the token as a GitHub secret called GITLAB_TOKEN.

Once all that is done, a random piece of content will be rebuilt and a PR will be opened every 3 days. You can also manually rebuild by creating an issue comment:

!rebuild  # Rebuild a random piece of content.
!rebuild folder  # Rebuild all of the content in this folder.
!rebuild folder/file  # Rebuild just this one piece.

The updated contents will be pushed to a new branch and a pull request will be opened automatically. If you make this comment on an open pull request, the updated content will be pushed to that branch.

rebuildaction's People

Contributors

christopher-dg avatar dependabot[bot] avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.