-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (46 loc) · 1.25 KB
/
Copy pathusing-artifacts.yml
File metadata and controls
50 lines (46 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Managing workflow artifacts
on: workflow_dispatch
jobs:
job-1:
name: Uploads an artifact
runs-on: ubuntu-latest
steps:
- shell: bash
run: |
echo "hello from job 1" > greetings.txt
- name: Upload greeting file from job 1
uses: actions/upload-artifact@v2
with:
name: my-files
path: greetings.txt
job-2:
name: Changes and Saves the previous artifact
runs-on: macos-latest
needs: [job-1]
steps:
- name: Download greetings.txt from job 1
uses: actions/download-artifact@v2
with:
name: my-files
- shell: bash
run: |
echo "a change has been made by job 2" >> greetings.txt
- name: Upload math result for job 2
uses: actions/upload-artifact@v2
with:
name: my-files
path: greetings.txt
job-3:
name: Uses the final version of the artifact
runs-on: windows-latest
needs: [job-2]
steps:
- name: Download new greetings file from job 2
uses: actions/download-artifact@v2
with:
name: my-files
- name: Print the final result
shell: bash
run: |
value=`cat greetings.txt`
echo The resultng file is $value