Skip to content

bissolli/gh-action-persist-workspace

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gh-action-persist-workspace

This action will help you to persist your workspace from job to job on your workflow! With that you will be able to split your jobs and parallelize them without the need to re-do that basic steps needed for all the jobs.

Usage

This action use actions/upload-artifact and actions/download-artifact under the hood.

Persist the workspace

name: My CI

on:
  pull_request:

jobs:
  init:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
      - name: Install dependencies
        run: npm install
      - uses: bissolli/gh-action-persist-workspace@v2
        with:
          action: persist

Retrieve a persisted workspace

name: My CI

on:
  pull_request:

jobs:
  init:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
      - name: Install dependencies
        run: npm install
      - uses: bissolli/gh-action-persist-workspace@v2
        with:
          action: persist

  build:
    needs: [init]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-node@v4
      - uses: chatfood/gh-action-persist-workspace@master
        with:
          action: retrieve
      - name: Build the project
        run: npm run build

Parallelize your jobs with the persisted workspace

name: My CI

on:
  pull_request:

jobs:
  init:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
      - name: Install dependencies
        run: npm install
      - uses: bissolli/gh-action-persist-workspace@v2
        with:
          action: persist

  test:
    needs: [init]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-node@v4
      - uses: bissolli/gh-action-persist-workspace@v2
        with:
          action: retrieve
      - name: Run unit tests
        run: npm run test

  build:
    needs: [init]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-node@v4
      - uses: bissolli/gh-action-persist-workspace@v2
        with:
          action: retrieve
      - name: Build the project
        run: npm run build

Accepted inputs

Input Type Default Description
action persist or retrieve persist Whether you would like to persist or retrieve the workspace.
artifactName string persisted-artifact Name of the generated artifact

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published