add version info

This commit is contained in:
Thomas Amland 2020-08-07 11:41:47 +02:00
parent b03377c121
commit d5e9dc719d
3 changed files with 9 additions and 6 deletions

View File

@ -2,6 +2,9 @@ name: CI
on: [push, pull_request]
env:
VERSION: ${{ github.sha }}
jobs:
build:
runs-on: ubuntu-latest
@ -16,7 +19,7 @@ jobs:
run: yarn install
- name: Build
run: yarn build
run: VUE_APP_VERSION=$VERSION yarn build
- name: Upload artifact
uses: actions/upload-artifact@v2

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<head data-version="<%= process.env.VUE_APP_VERSION %>">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<% if (process.env.NODE_ENV === "production") { %>

View File

@ -30,9 +30,9 @@
</div>
</template>
<script lang="ts">
import Vue from "vue";
import { mapMutations, mapState } from 'vuex';
import SearchForm from '@/search/SearchForm.vue';
import Vue from "vue";
import { mapMutations, mapState } from 'vuex';
import SearchForm from '@/search/SearchForm.vue';
export default Vue.extend({
components: {
@ -42,7 +42,7 @@ import SearchForm from '@/search/SearchForm.vue';
...mapState([
"server",
"username",
])
]),
},
methods: {
...mapMutations([