Skip to content

Commit 3747cc2

Browse files
Update deploy.yml
1 parent 7775cea commit 3747cc2

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build and Deploy Angular App
22
on:
33
push:
44
branches:
5-
- Production # Alterado de main para Production
5+
- Production
66
workflow_dispatch:
77

88
permissions:
@@ -22,16 +22,38 @@ jobs:
2222

2323
- name: Install dependencies
2424
run: npm ci
25+
26+
- name: Generate build timestamp
27+
id: timestamp
28+
run: echo "timestamp=$(date +'%Y%m%d_%H%M%S')" >> $GITHUB_OUTPUT
29+
30+
- name: Create logs directory
31+
run: mkdir -p deployment_logs
2532

2633
- name: Build Angular app
27-
run: npm run build --configuration production --output-path=docs --base-href="/${{ github.event.repository.name }}/"
34+
run: |
35+
npm run build --configuration production --output-path=docs --base-href="/${{ github.event.repository.name }}/" 2>&1 | tee deployment_logs/build_log_${{ steps.timestamp.outputs.timestamp }}.txt
2836
2937
- name: Add .nojekyll file
3038
run: touch docs/.nojekyll
3139

3240
- name: Deploy to GitHub Pages
41+
id: deploy
3342
uses: JamesIves/github-pages-deploy-action@v4
3443
with:
3544
folder: docs
3645
branch: gh-pages
3746
clean: true
47+
48+
- name: Log deployment result
49+
run: |
50+
echo "Deployment completed at $(date)" >> deployment_logs/deploy_summary_${{ steps.timestamp.outputs.timestamp }}.txt
51+
echo "Commit: ${{ github.sha }}" >> deployment_logs/deploy_summary_${{ steps.timestamp.outputs.timestamp }}.txt
52+
echo "Deployment status: ${{ steps.deploy.outcome }}" >> deployment_logs/deploy_summary_${{ steps.timestamp.outputs.timestamp }}.txt
53+
54+
- name: Archive deployment logs
55+
uses: actions/upload-artifact@v3
56+
with:
57+
name: deployment-logs-${{ steps.timestamp.outputs.timestamp }}
58+
path: deployment_logs/
59+
retention-days: 30

0 commit comments

Comments
 (0)