-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (72 loc) · 2.45 KB
/
cd.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
68
69
70
71
72
73
74
75
# This is a basic workflow to help you get started with Actions
name: CD-PRODUCTION
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [production]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Decrypt secret
run: ./scripts/decrypt_secret.sh .env.production.gpg ./.env
env:
SECRET_PASSPHRASE: ${{ secrets.SECRET_PASSPHRASE }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
build-args: |
"GEOLITE2_LICENSE_KEY=${{ secrets.GEOLITE2_LICENSE_KEY }}"
NEXT_PUBLIC_SHORT_DOMAIN=false
push: true
tags: ghcr.io/${{ github.repository }}:latest
# deploy:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - name: Deploy using ssh
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.HOST }}
# username: ${{ secrets.USERNAME }}
# password: ${{ secrets.PASSWORD }}
# port: 22
# script: |
# cd ~/clickdi
# # sh ./backup.sh
# sudo docker login -u ${{ github.repository_owner }} -p ${{ secrets.GITHUB_TOKEN }}
# sudo docker compose down
# sudo docker compose pull
# sudo docker compose up -d
# sudo sh ./migrate.sh
# sudo sh ./puppeteer.sh
# sudo docker system prune -f
# deploy:
# runs-on: ubuntu-latest
# needs: build
# environment:
# name: 'production'
# url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
# steps:
# - name: Deploy to Azure Web App
# id: deploy-to-webapp
# uses: azure/webapps-deploy@v2
# with:
# app-name: 'quickshare'
# slot-name: 'production'
# publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_QUICKSHARE }}