Skip to content
Open
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
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ jobs:
build-args: |
COMMIT_SHA=${{ github.sha }}
GITHUB_REPOSITORY=${{ github.repository }}
GH_ACCESS_TOKEN=${{ secrets.GITHUB_TOKEN }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new

Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ ARG COMMIT_SHA
ENV COMMIT_SHA=$COMMIT_SHA
ARG GITHUB_REPOSITORY
ENV GITHUB_REPOSITORY=$GITHUB_REPOSITORY
ARG GH_ACCESS_TOKEN
ENV GH_ACCESS_TOKEN=$GH_ACCESS_TOKEN
ENV NODE_ENV=production

RUN mkdir /app
Expand Down
7 changes: 7 additions & 0 deletions others/build-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ const fs = require('fs')
const fetch = require('node-fetch')

const SHA = process.env.COMMIT_SHA
const GH_ACCESS_TOKEN = process.env.GH_ACCESS_TOKEN

async function getCommitInfo() {
try {
const response = await fetch(
`https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/commits/${SHA}`,
{
method: 'GET',
headers: {
Authorization: `token ${GH_ACCESS_TOKEN}`,
},
},
)
const data = await response.json()

Expand Down