forked from didirus/AstralRinth
Add version support for the docker builds & local builds. (#128)
Add experimental support for github actions
This commit is contained in:
10
.github/workflows/docker-compile.yml
vendored
10
.github/workflows/docker-compile.yml
vendored
@@ -23,6 +23,14 @@ jobs:
|
||||
images: |
|
||||
ghcr.io/modrinth/knossos
|
||||
docker.io/modrinth/knossos
|
||||
-
|
||||
name: Get branch name
|
||||
id: vars
|
||||
run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/}
|
||||
-
|
||||
name: Get short SHA
|
||||
id: slug
|
||||
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
@@ -53,3 +61,5 @@ jobs:
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.docker_meta.outputs.tags }}
|
||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
||||
build-args: |
|
||||
VERSION_ID=${{ steps.vars.outputs.short_ref }}-${{ steps.slug.outputs.sha8 }}
|
||||
|
||||
14
Dockerfile
14
Dockerfile
@@ -1,21 +1,25 @@
|
||||
# Dockerfile
|
||||
FROM node:14.16.0-alpine
|
||||
|
||||
# create destination directory
|
||||
RUN mkdir -p /usr/src/knossos
|
||||
WORKDIR /usr/src/knossos
|
||||
|
||||
# update and install dependency
|
||||
RUN apk update && apk upgrade
|
||||
RUN apk add git
|
||||
|
||||
# create destination directory
|
||||
RUN mkdir -p /usr/src/knossos
|
||||
WORKDIR /usr/src/knossos
|
||||
|
||||
# copy the app, note .dockerignore
|
||||
COPY . /usr/src/knossos/
|
||||
RUN npm install
|
||||
RUN npm ci
|
||||
|
||||
ARG VERSION_ID=unknown
|
||||
|
||||
RUN npm run build
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
|
||||
ENV NUXT_HOST=0.0.0.0
|
||||
ENV NUXT_PORT=3000
|
||||
|
||||
|
||||
@@ -26,13 +26,18 @@
|
||||
<a target="_blank" href="https://twitter.com/modrinth">Twitter</a>
|
||||
</li>
|
||||
</ul>
|
||||
<span> © Guavy LLC </span>
|
||||
<span> © Guavy LLC </span><br />
|
||||
<span v-if="version !== 'unknown'">Version: {{ version }}</span>
|
||||
</footer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
version: {
|
||||
type: String,
|
||||
default: process.env.version || 'unknown',
|
||||
},
|
||||
centered: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
|
||||
@@ -182,4 +182,7 @@ export default {
|
||||
color: 'green',
|
||||
height: '2px',
|
||||
},
|
||||
env: {
|
||||
version: process.env.VERSION_ID || 'unknown',
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user