Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deploy workflow #2

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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