Skip to content

Commit 27ca0cf

Browse files
committed
add footer and build sha display
1 parent ce73903 commit 27ca0cf

File tree

7 files changed

+438
-620
lines changed

7 files changed

+438
-620
lines changed

.github/workflows/deploy.yml .github/workflows/release.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,18 @@ jobs:
3434
with:
3535
images: ${{ env.REGISTRY }}/${{ env.GITHUB_REPO }}
3636

37+
- name: Set outputs
38+
id: vars
39+
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
40+
3741
- name: Build and push Docker image
3842
uses: docker/build-push-action@v6
3943
with:
4044
context: .
4145
push: true
4246
tags: ${{ steps.meta.outputs.tags }}
4347
labels: ${{ steps.meta.outputs.labels }}
44-
build-args: github_token=${{ secrets.GITHUB_TOKEN }}
48+
build-args: |
49+
github_token=${{ secrets.GITHUB_TOKEN }}
50+
build_link=https://github.com/${{ env.GITHUB_REPO }}/tree/${{ github.sha }}
51+
build_sha=${{ steps.vars.outputs.sha_short }}

Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ COPY . .
1313
ARG github_token
1414
ENV GITHUB_TOKEN=$github_token
1515

16+
ARG build_link
17+
ENV BUILD_LINK=$build_link
18+
19+
ARG build_name
20+
ENV BUILD_NAME=$build_name
21+
1622
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
1723

1824
RUN pnpm run build

components/Footer.vue

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<template>
2+
<footer>
3+
<span>
4+
<span>atlas@</span>
5+
<a v-if="buildLink" :href="buildLink">{{ buildName }}</a>
6+
<span v-else>{{ buildName }}</span>
7+
</span>
8+
<span class="icons">
9+
<a title="View Source Code" href="https://github.com/VoidShake/Atlas">
10+
<GitHubIcon />
11+
</a>
12+
<a title="Help Translate" href="https://weblate.macarena.ceo/projects/void-shake/atlas/">
13+
<WeblateIcon />
14+
</a>
15+
</span>
16+
</footer>
17+
</template>
18+
19+
<script lang="ts" setup>
20+
import { GitHubIcon, WeblateIcon } from 'vue3-simple-icons';
21+
22+
const { buildName, buildLink } = useAppConfig()
23+
24+
</script>
25+
26+
<style lang="scss" scoped>
27+
footer {
28+
@apply py-4 px-5;
29+
@apply flex items-center;
30+
@apply grid grid-flow-col;
31+
32+
@apply bg-solid-700;
33+
34+
a {
35+
@apply text-accent-400;
36+
}
37+
38+
.icons {
39+
@apply justify-self-end;
40+
@apply grid grid-flow-col gap-3;
41+
42+
a {
43+
&:not(:hover) {
44+
@apply text-inherit transition-colors;
45+
}
46+
}
47+
}
48+
}
49+
50+
.dark-mode footer {
51+
@apply bg-solid-dark-900;
52+
}
53+
</style>

layouts/default.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
<section id="action-buttons" />
66
<slot />
77
</main>
8+
9+
<Footer />
810
</section>
911
</template>
1012

1113
<style scoped>
1214
main {
1315
@apply p-5 relative;
14-
height: calc(100vh - theme(spacing.14));
16+
min-height: calc(100vh - theme(spacing.14) - theme(spacing.14));
1517
}
1618
1719
#action-buttons {

nuxt.config.ts

+5
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ export default defineNuxtConfig({
7070
},
7171
},
7272

73+
appConfig: {
74+
buildName: process.env.BUILD_NAME ?? 'dev',
75+
buildLink: process.env.BUILD_LINK ?? '',
76+
},
77+
7378
experimental: {
7479
externalVue: false,
7580
},

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,8 @@
6464
"stylelint-config-recommended-vue": "^1.5.0",
6565
"stylelint-config-standard-scss": "^6.1.0",
6666
"v-network-graph": "^0.9.15"
67+
},
68+
"dependencies": {
69+
"vue3-simple-icons": "^13.2.0"
6770
}
6871
}

0 commit comments

Comments
 (0)