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

View File

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

View File

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