ci: build actions
This commit is contained in:
40
.gitea/workflows/build.yml
Normal file
40
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Build TGExporter
|
||||
run-name: ${{ gitea.actor }} Build TGExporter
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
Build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "20"
|
||||
|
||||
- name: Install dependencies and build frontend
|
||||
run: |
|
||||
cd frontend
|
||||
npm config set registry https://npm.hub.ipao.vip
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: "1.20"
|
||||
|
||||
- name: Build Go application
|
||||
run: |
|
||||
mkdir -p build
|
||||
go env -w GOPROXY=https://go.hub.ipao.vip,direct
|
||||
go build -o build/exporter ./cmd/exporter
|
||||
|
||||
- name: Build final Docker image
|
||||
run: |
|
||||
echo 'FROM docker.hub.ipao.vip/alpine:3.20' > Dockerfile
|
||||
echo 'COPY config.yml /root/.exporter.yml' >> Dockerfile
|
||||
echo 'COPY build/exporter /usr/local/exporter' >> Dockerfile
|
||||
docker build --push -t docker-af.hub.ipao.vip/rogeecn/tg-exporter:latest .
|
||||
@@ -15,7 +15,7 @@
|
||||
import ListItem from "@/components/ListItem.vue";
|
||||
import { getChannel } from "@/services/channels";
|
||||
import { getChannelMessages } from "@/services/messages";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { nextTick, onMounted, ref } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
const route = useRoute();
|
||||
@@ -31,9 +31,9 @@ const loadMore = async () => {
|
||||
|
||||
// page scroll to top with animation
|
||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||
messages.value = [];
|
||||
|
||||
const offset = messages.value[messages.value.length - 1].ID
|
||||
|
||||
messages.value = [];
|
||||
router.push({
|
||||
name: "channel-messages",
|
||||
params: {
|
||||
@@ -42,8 +42,11 @@ const loadMore = async () => {
|
||||
},
|
||||
});
|
||||
|
||||
messages.value = await getChannelMessages(route.params.channel, { offset: offset });
|
||||
console.log("messages", messages.value);
|
||||
// nextTick 干什么用的?
|
||||
nextTick(async () => {
|
||||
messages.value = await getChannelMessages(route.params.channel, { offset: offset });
|
||||
console.log("messages", messages.value);
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<script setup>
|
||||
import ListItem from "@/components/ListItem.vue";
|
||||
import { getFavoriteMessages } from "@/services/messages";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { nextTick, onMounted, ref } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
const route = useRoute();
|
||||
@@ -29,9 +29,10 @@ const loadMore = async () => {
|
||||
// page scroll to top with animation
|
||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||
|
||||
const offset = messages.value[messages.value.length - 1].ID
|
||||
|
||||
messages.value = [];
|
||||
|
||||
const offset = messages.value[messages.value.length - 1].ID
|
||||
router.push({
|
||||
name: "favorite-messages",
|
||||
params: {
|
||||
@@ -40,8 +41,10 @@ const loadMore = async () => {
|
||||
},
|
||||
});
|
||||
|
||||
messages.value = await getFavoriteMessages({ offset: offset });
|
||||
console.log("messages", messages.value);
|
||||
nextTick(async () => {
|
||||
messages.value = await getFavoriteMessages({ offset: offset });
|
||||
console.log("messages", messages.value);
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
||||
Reference in New Issue
Block a user