Skip to content

Commit

Permalink
Log git hash
Browse files Browse the repository at this point in the history
  • Loading branch information
banban525 committed Oct 26, 2023
1 parent 43f70ec commit d1eb5b9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to GitHub Container Registry
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}

- name: Write git hash
run: |
echo ref=${{ github.ref }}, sha=${{ github.sha }} > ./buildinfo
- name: Build and push
uses: docker/build-push-action@v2
Expand Down
8 changes: 8 additions & 0 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ const logger = new LogRepository();


Logger.info("", `${process.env.npm_package_name} ver.${process.env.npm_package_version}`);

if(fs.existsSync("../buildinfo"))
{
const buildInfo = fs.readFileSync("../buildinfo", {encoding:"utf-8"});
Logger.info("", buildInfo);
}


Logger.info("", "");

logger.output(`echonetTargetNetwork=${echonetTargetNetwork}`);
Expand Down

0 comments on commit d1eb5b9

Please sign in to comment.