-
Notifications
You must be signed in to change notification settings - Fork 6
67 lines (62 loc) · 2.5 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Publish Docker image
on:
push:
tags:
- v**
env:
REGISTRY: ghcr.io
DOMAIN: web-oauth-app.xuexb.com
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.PERSONAL_ACCESS_RW_NAME }}
password: ${{ secrets.PERSONAL_ACCESS_RW_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: deploy
uses: xuexb/dyups-actions/deploy@master
with:
ssh-host: ${{ secrets.SSH_HOST }}
ssh-username: ${{ secrets.SSH_USERNAME }}
ssh-key: ${{ secrets.SSH_KEY }}
ssh-port: ${{ secrets.SSH_PORT }}
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
dyups-server: ${{ secrets.DYUPS_SERVER }}
dyups-token: ${{ secrets.DYUPS_TOKEN }}
domain: ${{ env.DOMAIN }}
env-list: |
MYSQL_USER=${{ secrets.MYSQL_USER }}
MYSQL_PASSWORD=${{ secrets.MYSQL_PASSWORD }}
MYSQL_DATABASE=${{ secrets.MYSQL_DATABASE }}
MYSQL_HOST=${{ secrets.MYSQL_HOST }}
MYSQL_PORT=${{ secrets.MYSQL_PORT }}
OAUTH_GITHUB_CLIENT_ID=${{ secrets.OAUTH_GITHUB_CLIENT_ID }}
OAUTH_GITHUB_CLIENT_SECRET=${{ secrets.OAUTH_GITHUB_CLIENT_SECRET }}
OAUTH_QQ_APPID=${{ secrets.OAUTH_QQ_APPID }}
OAUTH_QQ_APPKEY=${{ secrets.OAUTH_QQ_APPKEY }}
OAUTH_QQ_CALLBACK=${{ secrets.OAUTH_QQ_CALLBACK }}
OAUTH_WEIBO_APPKEY=${{ secrets.OAUTH_WEIBO_APPKEY }}
OAUTH_WEIBO_APPSECRET=${{ secrets.OAUTH_WEIBO_APPSECRET }}
OAUTH_WEIBO_CALLBACK=${{ secrets.OAUTH_WEIBO_CALLBACK }}
OAUTH_BAIDU_APPKEY=${{ secrets.OAUTH_BAIDU_APPKEY }}
OAUTH_BAIDU_SECRETKEY=${{ secrets.OAUTH_BAIDU_SECRETKEY }}
OAUTH_BAIDU_CALLBACK=${{ secrets.OAUTH_BAIDU_CALLBACK }}