Skip to content

Commit

Permalink
Merge branch 'pr/19'
Browse files Browse the repository at this point in the history
  • Loading branch information
Xm798 committed Feb 15, 2024
2 parents a6400e1 + 4d94b60 commit 0eb4e49
Show file tree
Hide file tree
Showing 32 changed files with 276 additions and 67 deletions.
70 changes: 49 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,61 @@ on:
- "data/**"
workflow_dispatch:

env:
APP_NAME: vcards

jobs:
release-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Git status
run: |
git status
ls -lah
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up docker buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate app version
run: echo "APP_VERSION=$(date +'%y%m%d')" >> $GITHUB_ENV
- name: Set GHCR username
run: |
echo "GITHUB_USER=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
- name: Pre Build
run: |
yarn install
yarn build
gh release create $(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1) public/*
docker-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build image and push
- name: Docker build and push
uses: docker/build-push-action@v5
env:
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
IMAGE_VERSION=`cat package.json | jq -r '.version'`
echo $DOCKER_TOKEN | docker login -u metowolf --password-stdin
docker build -t metowolf/vcards:$IMAGE_VERSION .
docker push metowolf/vcards:$IMAGE_VERSION
echo $GITHUB_TOKEN | docker login ghcr.io -u metowolf --password-stdin
docker build -t ghcr.io/metowolf/vcards:$IMAGE_VERSION .
docker push ghcr.io/metowolf/vcards:$IMAGE_VERSION
DOCKER_USER: ${{ secrets.DOCKERHUB_USERNAME }}
with:
push: true
# https://github.com/docker/build-push-action/issues/513
context: .
platforms: |
linux/amd64
linux/arm64/v8
build-args: |
APP_NAME=${{ env.APP_NAME }}
APP_VERSION=${{ env.APP_VERSION }}
tags: |
ghcr.io/${{ env.GITHUB_USER }}/${{ env.APP_NAME }}:latest
ghcr.io/${{ env.GITHUB_USER }}/${{ env.APP_NAME }}:${{ env.APP_VERSION }}
${{ env.DOCKER_USER }}/${{ env.APP_NAME }}:latest
${{ env.DOCKER_USER }}/${{ env.APP_NAME }}:${{ env.APP_VERSION }}
77 changes: 39 additions & 38 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,50 +1,51 @@
FROM node as builder
FROM node:18-alpine

COPY . /app
WORKDIR /app
RUN yarn && yarn radicale
WORKDIR /app/

RUN apk add --no-cache radicale git && \
rm -rf /var/cache/apk/* && \
git clone https://github.com/Xm798/vCards/ && \
cd vCards && \
yarn && \
yarn radicale

FROM alpine
WORKDIR /app/

RUN apk add --no-cache \
radicale \
&& rm -rf /var/cache/apk/* \
\
&& { \
echo '[root]'; \
echo 'user: .+'; \
echo 'collection:'; \
echo 'permissions: R'; \
echo; \
echo '[principal]'; \
echo 'user: .+'; \
echo 'collection: {user}'; \
echo 'permissions: R'; \
echo; \
echo '[collections]'; \
echo 'user: .+'; \
echo 'collection: {user}/[^/]+'; \
echo 'permissions: rR'; \
RUN { \
echo '[root]'; \
echo 'user: .+'; \
echo 'collection:'; \
echo 'permissions: R'; \
echo; \
echo '[principal]'; \
echo 'user: .+'; \
echo 'collection: {user}'; \
echo 'permissions: R'; \
echo; \
echo '[collections]'; \
echo 'user: .+'; \
echo 'collection: {user}/[^/]+'; \
echo 'permissions: rR'; \
} > /etc/radicale/rights \
\
&& { \
echo '[server]'; \
echo 'hosts = 0.0.0.0:5232, [::]:5232'; \
echo; \
echo '[web]'; \
echo 'type = none'; \
echo; \
echo '[storage]'; \
echo 'type = multifilesystem'; \
echo 'filesystem_folder = /app/vcards'; \
echo; \
echo '[rights]'; \
echo 'type = from_file'; \
echo 'file = /etc/radicale/rights'; \
echo '[server]'; \
echo 'hosts = 0.0.0.0:5232, [::]:5232'; \
echo; \
echo '[web]'; \
echo 'type = none'; \
echo; \
echo '[storage]'; \
echo 'type = multifilesystem'; \
echo 'filesystem_folder = /app/radicale'; \
echo; \
echo '[rights]'; \
echo 'type = from_file'; \
echo 'file = /etc/radicale/rights'; \
} > /etc/radicale/config

COPY --from=builder /app/radicale/ /app/vcards/collection-root/cn/
RUN mkdir -p /app/radicale/collection-root/cn/ && \
cp -rf /app/vCards/radicale/* /app/radicale/collection-root/cn/

EXPOSE 5232

Expand Down
4 changes: 4 additions & 0 deletions data/互联网/小米.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ basic:
- 010-60606666
- 010-60642355
- 4001005678
- 10685332013110000000
- 10658123720699
- 106934195799
- 10687840138000000003
url: https://www.mi.com/
20 changes: 20 additions & 0 deletions data/互联网/腾讯.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,24 @@ basic:
- 021-54569595
- 028-85225111
- 020-81167888
- 10685096769
- 106302161004
- 10658636712769
- 1065905900375
- 106300126856551216
- 10691652702315362
- 106300560124360
- 106559600758662333
- 10655960066944360
- 106559600683441004
- 10655960073210655960
- 1068328350521004
- 10690333641560620137
- 106929105460620137
- 1069033331327234
- 1069293624630322
- 10655960072971910336
- 10655960060710655960
- 10655960057250362
- 10655960068310655960
url: https://www.tencent.com/
19 changes: 19 additions & 0 deletions data/互联网/腾讯云.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,23 @@ basic:
organization: 腾讯云
cellPhone:
- 4009-100-100,1
- 106843676000010
- 10690074974400102
- 10693126730920
- 10692366030920
- 10692947030920
- 10692947130920
- 1068509730920
- 10683176930920
- 1068217405000020
- 106932740430920
- 10655960070321000360
- 10683323974400102
- 10692423030920
- 10681546930920
- 10693413930920
- 10683283930920
- 10692947130920
- 10692947030920
- 10692366030920
url: https://cloud.tencent.com/
1 change: 1 addition & 0 deletions data/互联网/豆瓣.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ basic:
organization: 豆瓣
cellPhone:
- 010-84799058
- 106902691035
url: https://www.douban.com/
21 changes: 21 additions & 0 deletions data/互联网/阿里云.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,25 @@ basic:
organization: 阿里云
cellPhone:
- 95187
- 10685601000000458519
- 10684016634200458748
- 10682566003500458748
- 10684741004000458748
- 10681483000000458519
- 10681760000000458519
- 10693097000000458519
- 10693119520000000112
- 10693119193700000001
- 10693924952000045868
- 1069094572404416475
- 106947764416475
- 10693924983520441647
- 10681483000000459000
- 10684741004000459000
- 10682566003500458000
- 10684016634200460000
- 10685601000000459000
- 10684016634200000045
- 10686755500000458576
- 10684741004000458748
url: https://www.aliyun.com/
14 changes: 14 additions & 0 deletions data/其它/Apple.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,18 @@ basic:
- 400-666-8800
- 400-627-2273
- 400-619-8141
- 1069071288800001
- 1069071288899001
- 1068266649356088001
- 1069353891886871107
- 1069046888005
- 1069071288899005
- 10690362886871107
- 106824279394880085
- 106935389571107
- 106824279396880085
- 106907128899001
- 1069123971107
- 12583110680079608800
- 106800796088001
url: https://www.apple.com.cn/
1 change: 1 addition & 0 deletions data/外卖订餐/海底捞.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ basic:
organization: 海底捞
cellPhone:
- 4009107107
- 10681876201954
url: https://www.haidilao.com/
1 change: 1 addition & 0 deletions data/外卖订餐/肯德基.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ basic:
organization: 肯德基
cellPhone:
- 4008823823
- 106838151030203
url: https://www.kfc.com.cn/
1 change: 1 addition & 0 deletions data/影音娱乐/腾讯视频.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ basic:
organization: 腾讯视频
cellPhone:
- 0755-83765566
- 1069051527592723
url: https://v.qq.com/
3 changes: 3 additions & 0 deletions data/快递物流/中国邮政.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ basic:
organization: 中国邮政
cellPhone:
- 11183
- 1069066211185
- 1068242711185
- 106800982011
url: https://www.chinapost.com.cn/
10 changes: 10 additions & 0 deletions data/快递物流/圆通速递.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,14 @@ basic:
cellPhone:
- 95554
- 95161 # 派件提醒
- 10690080918811082061
- 106903873871923
- 106921050927
- 106939249027166517
- 10655960060736173
- 1068142700177192
- 10692193438633907283
- 10681300971923
- 10655960070337767379
- 10655960072971924
url: https://www.yto.net.cn/
35 changes: 35 additions & 0 deletions data/电商购物/京东.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,39 @@ basic:
cellPhone:
- 95118
- 950618
- 10685896241326769
- 1068138603140146303
- 10680554041356414
- 1069165270196303
- 10681386013886414
- 10693920123412588676
- 10680554041326770
- 106913780026769
- 10693920000812588640
- 1068070813796303
- 106926953140146303
- 106902197395465567
- 10692694580146303
- 106908626206615007
- 10691652160250014630
- 10682471499112330077
- 10691440365701
- 10692173580196300
- 106802062226701
- 10692041580146303
- 106824714991007701
- 1068138603140196300
- 10682229515863596300
- 1069312615146701
- 1068182410046303
- 10630200563010701
- 106903030072002701
- 10655960073219107626
- 1069454608756300
- 1069293612131100770
- 1069119186222
- 10655960067800100196
- 1069269513796303
- 10691673004345014
- 10655960060700100196
url: https://www.jd.com/
2 changes: 2 additions & 0 deletions data/电商购物/什么值得买.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ basic:
organization: 什么值得买
cellPhone:
- 010-56640700
- 106913908305470
- 10691686130788
url: https://www.smzdm.com/
Binary file added data/电商购物/多抓鱼.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions data/电商购物/多抓鱼.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
basic:
organization: 多抓鱼
cellPhone:
- 10688175900000433348
- 10693200922217270
url: https://www.duozhuayu.com/
1 change: 1 addition & 0 deletions data/电商购物/支付宝.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ basic:
organization: 支付宝
cellPhone:
- 95188
- 106843626150040
url: https://www.alipay.com/
7 changes: 7 additions & 0 deletions data/通讯服务/中国移动.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,11 @@ basic:
cellPhone:
- 10086
- 1008611
- 10086900
- 100862001142530690
- 1008610020017771
- 10658102
- 1008619901
- 10085
- 1065800431
url: https://www.10086.cn/
Loading

0 comments on commit 0eb4e49

Please sign in to comment.