Skip to content

Commit 67b7060

Browse files
Update README.md
1 parent f2e1b8a commit 67b7060

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

README.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,47 @@ on:
2727

2828
This section of code basically means it will only run when a push is made to the master branch and one of the file types is a .mlx file. If not .mlx files are pushed, we don’t continue.
2929

30-
![image](https://github.com/opencobra/cobratoolbox/assets/68754265/bfdb2072-f7d7-480f-b483-a8b701149284)
30+
```
31+
jobs:
32+
copy-changes:
33+
runs-on: self-hosted
34+
steps:
35+
- name: Checkout Source Repo
36+
uses: actions/checkout@v2
37+
with:
38+
repository: 'openCOBRA/COBRA.tutorials'
39+
token: ${{ secrets.GITHUB_TOKEN }}
40+
fetch-depth: 0
41+
```
3142

3243

3344
- Next, we have a series of ‘jobs’ to compute.
3445
- The ‘runs-on’ parameter indicates where these jobs are computed. Here I specify it runs on ‘self-hosted’ because we need Matlab on King to run the .mlx to html. Generally, I would avoid using a self-hosted server but since Matlab is not an opensource programming language it needs to be ran a computer which has Matlab installed with a license.
3546
- There are several steps to do in the jobs section. Here the first step is to checkout the source repo i.e. get all the details about the repo and the pushes made to the repo.
3647

37-
![image](https://github.com/opencobra/cobratoolbox/assets/68754265/92cc085c-9d8d-4451-a9ef-c4efee7e41d7)
48+
```
49+
- name: Get All Changed Files
50+
id: files
51+
uses: jitterbit/get-changed-files@v1
52+
53+
- name: Find changed files
54+
id: getfile
55+
run: |
56+
files=$(echo "${{ steps.files.outputs.all }}" | tr ' ' '\n' | grep -E '\.mlx$')
57+
echo "::set-output name=file::$files"
58+
```
3859

3960

4061
- Here we have two more steps. The first step in this picture is used to find all the files that have been changed based on the most recent push.
4162
- The next step is then used to find all the .mlx files that were pushed to the repository.
4263

43-
![image](https://github.com/opencobra/cobratoolbox/assets/68754265/6f7af540-8b60-425c-89d1-1cf0ce5c9e9d)
64+
```
65+
- name: Give execute permission to the script
66+
run: chmod +x build.sh
67+
68+
- name: Give execute permission to the other script
69+
run: chmod +x setup.sh
70+
```
4471

4572

4673
The chmod command just makes the .sh files executable.

0 commit comments

Comments
 (0)