Skip to content

Commit 20367f3

Browse files
Update first-action.yml
1 parent a29c01b commit 20367f3

1 file changed

Lines changed: 28 additions & 13 deletions

File tree

.github/workflows/first-action.yml

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,40 @@
1-
name: Deploy GitHub Pages
1+
name: My First Github Actions
22

33
on:
4-
workflow_run:
5-
workflows: ["My First GitHub Actions"]
6-
types:
7-
- completed
4+
push:
5+
branches:
6+
- main
87

98
permissions:
109
contents: read
1110
pages: write
1211
id-token: write
13-
12+
# on: [push]
1413
jobs:
15-
deploy:
14+
test:
1615
runs-on: ubuntu-latest
1716
steps:
18-
- name: Download artifact
19-
uses: actions/download-artifact@v4
17+
- name: Checkout Repository
18+
uses: actions/checkout@v4
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.x'
23+
- name: Install Dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
27+
- name: Run Test
28+
run: python test.py
29+
upload-artifact:
30+
runs-on: ubuntu-latest
31+
needs: test
32+
steps:
33+
- name: Checkout Repository
34+
uses: actions/checkout@v4
35+
- name: Upload artifact for deployment
36+
uses: actions/upload-pages-artifact@v3
2037
with:
21-
name: github-pages
2238
path: ./
23-
24-
- name: Deploy to GitHub Pages
25-
uses: actions/deploy-pages@v1
39+
40+

0 commit comments

Comments
 (0)