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 ListItem from "@/components/ListItem.vue";
|
||||||
import { getChannel } from "@/services/channels";
|
import { getChannel } from "@/services/channels";
|
||||||
import { getChannelMessages } from "@/services/messages";
|
import { getChannelMessages } from "@/services/messages";
|
||||||
import { onMounted, ref } from "vue";
|
import { nextTick, onMounted, ref } from "vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
@@ -31,9 +31,9 @@ const loadMore = async () => {
|
|||||||
|
|
||||||
// page scroll to top with animation
|
// page scroll to top with animation
|
||||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||||
messages.value = [];
|
|
||||||
|
|
||||||
const offset = messages.value[messages.value.length - 1].ID
|
const offset = messages.value[messages.value.length - 1].ID
|
||||||
|
|
||||||
|
messages.value = [];
|
||||||
router.push({
|
router.push({
|
||||||
name: "channel-messages",
|
name: "channel-messages",
|
||||||
params: {
|
params: {
|
||||||
@@ -42,8 +42,11 @@ const loadMore = async () => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
messages.value = await getChannelMessages(route.params.channel, { offset: offset });
|
// nextTick 干什么用的?
|
||||||
console.log("messages", messages.value);
|
nextTick(async () => {
|
||||||
|
messages.value = await getChannelMessages(route.params.channel, { offset: offset });
|
||||||
|
console.log("messages", messages.value);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import ListItem from "@/components/ListItem.vue";
|
import ListItem from "@/components/ListItem.vue";
|
||||||
import { getFavoriteMessages } from "@/services/messages";
|
import { getFavoriteMessages } from "@/services/messages";
|
||||||
import { onMounted, ref } from "vue";
|
import { nextTick, onMounted, ref } from "vue";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
@@ -29,9 +29,10 @@ const loadMore = async () => {
|
|||||||
// page scroll to top with animation
|
// page scroll to top with animation
|
||||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||||
|
|
||||||
|
const offset = messages.value[messages.value.length - 1].ID
|
||||||
|
|
||||||
messages.value = [];
|
messages.value = [];
|
||||||
|
|
||||||
const offset = messages.value[messages.value.length - 1].ID
|
|
||||||
router.push({
|
router.push({
|
||||||
name: "favorite-messages",
|
name: "favorite-messages",
|
||||||
params: {
|
params: {
|
||||||
@@ -40,8 +41,10 @@ const loadMore = async () => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
messages.value = await getFavoriteMessages({ offset: offset });
|
nextTick(async () => {
|
||||||
console.log("messages", messages.value);
|
messages.value = await getFavoriteMessages({ offset: offset });
|
||||||
|
console.log("messages", messages.value);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user