Skip to content

Commit 65c0a69

Browse files
authored
fix(cd): fix deploy workflow (#2)
Signed-off-by: Mohamed Elkholy <mkh117@gmail.com>
1 parent 63c41b2 commit 65c0a69

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,29 +57,37 @@ jobs:
5757
runs-on: ubuntu-latest
5858
steps:
5959
- uses: actions/checkout@v4
60+
- name: Get commit message
61+
id: get_commit_message
62+
run: |
63+
COMMIT_MESSAGE_HEADER=$(git log -1 --pretty=%B | head -n 1 | sed "s/#/PR#/")
64+
echo "header=${COMMIT_MESSAGE_HEADER}" >> $GITHUB_OUTPUT
65+
- name: Cloning awesomehub/awesomehub.github.io
66+
uses: actions/checkout@v4
6067
with:
6168
repository: awesomehub/awesomehub.github.io
6269
token: ${{ secrets.PAT }}
6370
path: deploy
64-
- run: rm -r deploy/dist/*
71+
- name: Prepare repository
72+
run: rm -r deploy/dist/*
6573
- uses: actions/download-artifact@v4
66-
id: download
6774
with:
6875
name: build-art
6976
path: deploy/dist
70-
- uses: peter-evans/create-pull-request@v3
77+
- name: Create deploy pull request
78+
uses: peter-evans/create-pull-request@v7
7179
with:
7280
branch: staging
7381
path: deploy
7482
token: ${{ secrets.PAT }}
75-
commit-message: ${{ github.event.head_commit.message }} ${{ github.event.head_commit.url }}
76-
title: ${{ github.event.head_commit.message }}
83+
commit-message: ${{ steps.get_commit_message.outputs.header }} ${{ github.event.head_commit.url }}
84+
title: ${{ steps.get_commit_message.outputs.header }}
7785
body: |
7886
## Build Information
7987
- ### Action
8088
${{ github.workflow }} [#${{ github.run_number }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
8189
- ### Commit
82-
${{ github.event.head_commit.message }} ${{ github.event.head_commit.url }}
90+
${{ steps.get_commit_message.outputs.header }} ${{ github.event.head_commit.url }}
8391
- ### Author
8492
@${{ github.actor }}
8593
---

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This repository contains the sources for AwesomeHub Angular application.
77
> Live production build can be found at [awesomehub.js.org][website-url]
88
99
## About
10-
The App was originaly built for educational purposes and to experiment with [Angular 2](https://v2.angular.io/), [NgRx](https://ngrx.io/) and [RxJS](https://www.learnrxjs.io/), but
10+
The App was originally built for educational purposes and to experiment with [Angular 2](https://v2.angular.io/), [NgRx](https://ngrx.io/) and [RxJS](https://www.learnrxjs.io/), but
1111
I have recently managed to update the codebase to [Angular 12](https://v12.angular.io/), then to [Angular 18](https://angular.dev/).
1212

1313
The App UI is built on top of the good old [Material Design Lite](https://getmdl.io/) library, It's much lighter than [Angular Material](https://material.angular.io/)

scripts/postbuild.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async function main() {
3535
}
3636
const headers = new Map(Object.entries(defaultHeaders))
3737
const html = fs.readFileSync(index, { encoding: 'utf-8'})
38-
const matches = html.matchAll(/["']([^"'.]+\.[a-z0-9]{20})(\.(css|js))["']/gm)
38+
const matches = html.matchAll(/["']([^"'.]+\.[a-z0-9]{16})(\.(css|js))["']/gm)
3939
for (const [, filename, ext] of matches) {
4040
const asset = filename + ext
4141
if (!headers.has(asset)) {

0 commit comments

Comments
 (0)