Skip to content

Commit

Permalink
Show commit hash on homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
aldafu committed Aug 25, 2022
1 parent fbb8722 commit 6df0fed
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
- name: Convert repository name to lower case
run: |
echo REPOSITORY_LC=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Get short commit ref
run: |
echo SHORT_SHA=$(git rev-parse --short HEAD) >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
Expand All @@ -48,7 +51,7 @@ jobs:
export CR_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
echo $CR_GITHUB_TOKEN | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
docker pull ghcr.io/${{ env.REPOSITORY_LC }}:${{inputs.docker_tag}}
docker run --name ${{inputs.envname}} -d -p ${{inputs.docker_port}}:80 --restart unless-stopped ghcr.io/${{ env.REPOSITORY_LC }}:${{inputs.docker_tag}}
docker run --name ${{inputs.envname}} --env SHORT_SHA=${{ env.SHORT_SHA }} -d -p ${{inputs.docker_port}}:80 --restart unless-stopped ghcr.io/${{ env.REPOSITORY_LC }}:${{inputs.docker_tag}}
host: ${{ secrets.host }}
user: ${{ secrets.user }}
key: ${{ secrets.private_key }}
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ RUN python2.7 get-pip.py
RUN pip2 install matplotlib
RUN update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java

RUN rm /var/www/html/index.html
COPY --chown=www-data:www-data . /var/www/html/
RUN cd /var/www/html/ISOSegmentValidator/public/linux && make clean && make -j

Expand Down
6 changes: 0 additions & 6 deletions index.html

This file was deleted.

12 changes: 12 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html style="height:100%">
<body style="margin:0px;padding:0px;overflow:hidden;height:100%">
<iframe src="Conformance-Frontend/index.html" name="targetframe" style="overflow:hidden;height:100%;width:100%" height="100%" width="100%" frameborder="0"></iframe>
<div style="position: absolute;top: 0;right: 0;">github: <?php
$shortsha=getenv('SHORT_SHA');
$githublink="<a href=\"https://github.com/Dash-Industry-Forum/DASH-IF-Conformance/tree/$shortsha\">$shortsha</a>";
$version = !$shortsha ? 'unknown' : $githublink;
echo $version;
?></div>
</body>
</html>

0 comments on commit 6df0fed

Please sign in to comment.