Skip to content

Commit

Permalink
Create an asset dir for all projects and use it to publish the gir ha…
Browse files Browse the repository at this point in the history
…sh (#30)
  • Loading branch information
anxolin authored May 24, 2024
1 parent d5e55b9 commit ebef023
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: yarn install

- name: Write commit hash in the assets directory
run: echo "${{ github.sha }}" > assets/git-commit-hash.txt

- run: yarn build

- name: Write commit hash
run: echo "${{ github.sha }}" > dist/git-commit-hash.txt

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
11 changes: 10 additions & 1 deletion apps/api/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,16 @@
"main": "apps/api/src/main.ts",
"tsConfig": "apps/api/tsconfig.app.json",
"assets": [
"apps/api/src/assets"
{
"input": "apps/api/src/assets",
"output": "apps/api/src",
"glob": "**/*"
},
{
"input": "assets",
"output": "apps/api/src",
"glob": "**/*"
}
],
"generatePackageJson": true,
"esbuildOptions": {
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/app/routes/about/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const example: FastifyPluginAsync = async (fastify): Promise<void> => {
* Read a file with the git commit hash (generated for example using github actions)
*/
function getCommitHash(): string | undefined {
const filePath = join(__dirname, '../../../../../../../../', GIT_COMMIT_HASH_FILE)
const filePath = join(__dirname, '../../..', GIT_COMMIT_HASH_FILE)
try {
return readFileSync(filePath, 'utf-8')
} catch (error) {
Expand Down
Empty file added assets/.gitkeep
Empty file.

0 comments on commit ebef023

Please # to comment.