Skip to content

Commit 5c71b32

Browse files
committed
feat: update comprehensive curriculum and harden CI/CD workflows
1 parent bdfa002 commit 5c71b32

5 files changed

Lines changed: 17860 additions & 9161 deletions

File tree

‎.github/workflows/docker.yml‎

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,34 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
13+
14+
- name: Check DockerHub Credentials
15+
id: check_creds
16+
run: |
17+
if [ -n "${{ secrets.DOCKERHUB_USERNAME }}" ] && [ -n "${{ secrets.DOCKERHUB_PASSWORD }}" ]; then
18+
echo "has_creds=true" >> $GITHUB_OUTPUT
19+
else
20+
echo "has_creds=false" >> $GITHUB_OUTPUT
21+
echo "DockerHub credentials not provided; skipping image push."
22+
fi
1323
1424
- name: DockerHub Login
15-
uses: docker/login-action@v2.1.0
25+
if: steps.check_creds.outputs.has_creds == 'true'
26+
uses: docker/login-action@v3
1627
with:
1728
username: ${{ secrets.DOCKERHUB_USERNAME }}
1829
password: ${{ secrets.DOCKERHUB_PASSWORD }}
1930

20-
- name: Build the Docker image
21-
run: docker build . --file Dockerfile --tag ${{ secrets.DOCKERHUB_USERNAME }}/learn-angular
31+
- name: Set up Docker Buildx
32+
if: steps.check_creds.outputs.has_creds == 'true'
33+
uses: docker/setup-buildx-action@v3
2234

23-
- name: Docker Push
24-
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/learn-angular
35+
- name: Build and Push Docker image
36+
if: steps.check_creds.outputs.has_creds == 'true'
37+
uses: docker/build-push-action@v6
38+
with:
39+
context: .
40+
file: ./Dockerfile
41+
push: true
42+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/learn-angular:latest

‎.github/workflows/releases.yml‎

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,39 @@ on:
44
branches:
55
- main
66

7+
permissions:
8+
contents: write
9+
710
jobs:
811
changelog:
912
runs-on: ubuntu-latest
1013

1114
steps:
12-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
16+
17+
- name: Check Personal Access Token
18+
id: check_token
19+
run: |
20+
if [ -n "${{ secrets.PA_TOKEN }}" ]; then
21+
echo "has_token=true" >> $GITHUB_OUTPUT
22+
else
23+
echo "has_token=false" >> $GITHUB_OUTPUT
24+
echo "PA_TOKEN secret not configured; skipping automated release creation."
25+
fi
1326
14-
- name: conventional Changelog Action
27+
- name: Conventional Changelog Action
28+
if: steps.check_token.outputs.has_token == 'true'
1529
id: changelog
16-
uses: TriPSs/conventional-changelog-action@v3.7.1
30+
uses: TriPSs/conventional-changelog-action@v5
1731
with:
1832
github-token: ${{ secrets.PA_TOKEN }}
19-
version-file: './releases.json,./package.json,./package-lock.json'
33+
version-file: './releases.json,./package.json'
2034

21-
- name: create release
22-
uses: actions/create-release@v1
23-
if: ${{ steps.changelog.outputs.skipped == 'false' }}
24-
env:
25-
GITHUB_TOKEN: ${{ secrets.PA_TOKEN }}
35+
- name: Create Release
36+
if: steps.check_token.outputs.has_token == 'true' && steps.changelog.outputs.skipped == 'false'
37+
uses: softprops/action-gh-release@v2
2638
with:
39+
token: ${{ secrets.PA_TOKEN }}
2740
tag_name: ${{ steps.changelog.outputs.tag }}
28-
release_name: ${{ steps.changelog.outputs.tag }}
41+
name: ${{ steps.changelog.outputs.tag }}
2942
body: ${{ steps.changelog.outputs.clean_changelog }}

0 commit comments

Comments
 (0)