added upload and download action #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: First Workflow | |
on: push | |
jobs: | |
first_job: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Welcome message | |
run: echo 'My First Github Actions Job' | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.repository }} | |
- name: Read Readme | |
run: cat README.md | |
- name: List Files | |
run: ls | |
- name: Print envs | |
run: printenv | |
- name: Perform multiple actions | |
run: | | |
echo 'Running multiple commands' | |
ls -a | |
- name: Installing cowsay | |
run: sudo apt install cowsay -y | |
- name: Execute cowsay | |
run: | | |
cowsay -f dragon "Hello Yatharth!!" >> drag.txt | |
cat drag.txt | |
- name: Execute shell script | |
run: | | |
chmod +x cowsay-script.sh | |
./cowsay-script.sh | |
- name: Upload files | |
uses: actions/upload-artifact@v4.4.3 | |
with: | |
name: dragon | |
path: drag.txt | |
second_job: | |
runs-on: ubuntu-latest | |
needs: | |
- first_job | |
steps: | |
- name: Welcome message | |
run: echo 'My Second Github Actions Job' | |
- name: Download a Build Artifact | |
uses: actions/download-artifact@v4.1.8 | |
with: | |
name: dragon | |
path: dragon.txt | |
- name: Check cowsay | |
run: | | |
ls -la | |
cat dragon.txt |