Skip to content

Commit

Permalink
fix(cd): fix deploy workflow (#2)
Browse files Browse the repository at this point in the history
Signed-off-by: Mohamed Elkholy <mkh117@gmail.com>
  • Loading branch information
mohatt authored Sep 4, 2024
1 parent 63c41b2 commit 65c0a69
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,29 +57,37 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get commit message
id: get_commit_message
run: |
COMMIT_MESSAGE_HEADER=$(git log -1 --pretty=%B | head -n 1 | sed "s/#/PR#/")
echo "header=${COMMIT_MESSAGE_HEADER}" >> $GITHUB_OUTPUT
- name: Cloning awesomehub/awesomehub.github.io
uses: actions/checkout@v4
with:
repository: awesomehub/awesomehub.github.io
token: ${{ secrets.PAT }}
path: deploy
- run: rm -r deploy/dist/*
- name: Prepare repository
run: rm -r deploy/dist/*
- uses: actions/download-artifact@v4
id: download
with:
name: build-art
path: deploy/dist
- uses: peter-evans/create-pull-request@v3
- name: Create deploy pull request
uses: peter-evans/create-pull-request@v7
with:
branch: staging
path: deploy
token: ${{ secrets.PAT }}
commit-message: ${{ github.event.head_commit.message }} ${{ github.event.head_commit.url }}
title: ${{ github.event.head_commit.message }}
commit-message: ${{ steps.get_commit_message.outputs.header }} ${{ github.event.head_commit.url }}
title: ${{ steps.get_commit_message.outputs.header }}
body: |
## Build Information
- ### Action
${{ github.workflow }} [#${{ github.run_number }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
- ### Commit
${{ github.event.head_commit.message }} ${{ github.event.head_commit.url }}
${{ steps.get_commit_message.outputs.header }} ${{ github.event.head_commit.url }}
- ### Author
@${{ github.actor }}
---
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This repository contains the sources for AwesomeHub Angular application.
> Live production build can be found at [awesomehub.js.org][website-url]
## About
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
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
I have recently managed to update the codebase to [Angular 12](https://v12.angular.io/), then to [Angular 18](https://angular.dev/).

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/)
Expand Down
2 changes: 1 addition & 1 deletion scripts/postbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async function main() {
}
const headers = new Map(Object.entries(defaultHeaders))
const html = fs.readFileSync(index, { encoding: 'utf-8'})
const matches = html.matchAll(/["']([^"'.]+\.[a-z0-9]{20})(\.(css|js))["']/gm)
const matches = html.matchAll(/["']([^"'.]+\.[a-z0-9]{16})(\.(css|js))["']/gm)
for (const [, filename, ext] of matches) {
const asset = filename + ext
if (!headers.has(asset)) {
Expand Down

0 comments on commit 65c0a69

Please sign in to comment.