Skip to content

Commit 0dca344

Browse files
committed
updating linting and formatting action
1 parent 569a40a commit 0dca344

File tree

6 files changed

+37
-27
lines changed

6 files changed

+37
-27
lines changed

.github/dependabot.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Set update schedule for GitHub Actions
2+
version: 2
3+
updates:
4+
5+
- package-ecosystem: "github-actions"
6+
directory: "/"
7+
schedule:
8+
# Check for updates to GitHub Actions every week
9+
interval: "daily"

.github/workflows/build-image.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ jobs:
1515

1616
- name: Build Docker Image
1717
run: |
18-
docker build -t awesome-fastapi:${{ github.sha }} .
18+
docker build -t python-fastapi:${{ github.sha }} .
1919

.github/workflows/main.yml

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
name: Main Workflow
22
on:
33
push:
4-
4+
branches:
5+
- main
56
workflow_dispatch:
67

78
permissions:
@@ -11,19 +12,18 @@ permissions:
1112
id-token: write
1213
packages: write
1314

14-
15-
jobs:
16-
build-image:
17-
uses: ./.github/workflows/build-image.yml
15+
jobs:
16+
build-image:
17+
uses: ./.github/workflows/build-image.yml
1818

19-
lint-format:
20-
uses: ./.github/workflows/lint-format.yml
21-
needs: build-image
22-
23-
unit-sec-scan:
24-
uses: ./.github/workflows/unit-sec-test.yml
25-
needs: lint-format
26-
27-
push-docker-image:
28-
uses: ./.github/workflows/push-docker-image.yml
29-
needs: unit-sec-scan
19+
lint-format:
20+
uses: ./.github/workflows/lint-format.yml
21+
needs: build-image
22+
23+
unit-sec-scan:
24+
uses: ./.github/workflows/unit-sec-test.yml
25+
needs: lint-format
26+
27+
push-docker-image:
28+
uses: ./.github/workflows/push-docker-image.yml
29+
needs: unit-sec-scan

.github/workflows/push-docker-image.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
env:
88
# Use docker.io for Docker Hub if empty
99
REGISTRY: ghcr.io
10-
IMAGE_NAME: 'awesome-fastapi'
10+
IMAGE_NAME: 'python-fastapi'
1111

1212

1313
jobs:

.github/workflows/unit-sec-test.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Unit and Security Testing
1+
name: Unit and Security Scanning
22
on:
33
workflow_call:
44

@@ -7,6 +7,7 @@ jobs:
77
testing_phase:
88
name: Run unit test
99
runs-on: ubuntu-latest
10+
needs: ['trivy_scans', 'owasp_zap_scan'] # Ensure this job runs after the security scans
1011

1112
steps:
1213
- name: Checkout repository
@@ -29,12 +30,12 @@ jobs:
2930

3031
- name: Build Docker Image
3132
run: |
32-
docker build -t awesome-fastapi:${{ github.sha }} . ###- This section needed to be added becasue the image was not persisting between jobs--##
33+
docker build -t python-fastapi:${{ github.sha }} . ###- This section needed to be added becasue the image was not persisting between jobs--##
3334
3435
- name: Run Trivy Vulnerability Scanner
3536
uses: aquasecurity/[email protected]
3637
with:
37-
image-ref: 'awesome-fastapi:${{ github.sha }}'
38+
image-ref: 'python-fastapi:${{ github.sha }}'
3839
format: 'sarif'
3940
output: 'trivy-results.sarif'
4041
severity: 'CRITICAL,HIGH'
@@ -55,8 +56,8 @@ jobs:
5556
# Run Docker Image in detached mode
5657
- name: Build Docker Image
5758
run: |
58-
docker build -t awesome-fastapi:${{ github.sha }} .
59-
docker run -d -p 8080:8080 awesome-fastapi:${{ github.sha }}
59+
docker build -t python-fastapi:${{ github.sha }} .
60+
docker run -d -p 8080:8080 python-fastapi:${{ github.sha }}
6061
6162
- name: Wait for Docker container to be ready
6263
run: sleep 30

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,24 @@ gcp-python-fastapi/
3636
If you haven't cloned the project yet, use the following command:
3737

3838
```bash
39-
git clone https://github.com/your-username/awesome-fastapi.git
40-
cd awesome-fastapi
39+
git clone https://github.com/your-username/python-fastapi.git
40+
cd python-fastapi
4141
```
4242

4343
### 2. Build the Docker image
4444

4545
To build the Docker image, run the following command in the root of the project directory:
4646

4747
```bash
48-
docker build -t awesome-fastapi .
48+
docker build -t python-fastapi .
4949
```
5050

5151
### 3. Run the Docker container
5252

5353
After the image is built, run the container:
5454

5555
```bash
56-
docker run -d -p 80:80 awesome-fastapi
56+
docker run -d -p 80:80 python-fastapi
5757
```
5858

5959
This command will run the FastAPI app on port 80 of your localhost.

0 commit comments

Comments
 (0)