-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (62 loc) · 1.88 KB
/
default.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
name: CICD
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '^1.15.0'
- uses: actions/setup-node@v2
with:
node-version: '15.x'
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.35
working-directory: api
- name: assets-build
run: make assets
- name: make-api
run: make build
- name: container
run: make container
deploy:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# https://github.com/marketplace/actions/build-and-push-docker-images
# - name: Build and push latest
# id: docker_build
# uses: docker/build-push-action@v2
# with:
# push: true
# tags: advenjourney/api:latest
# - name: Image digest
# run: echo ${{ steps.docker_build.outputs.digest }}
- name: push to dockerhub
run: make container-push
- name: Staging deployment
uses: appleboy/ssh-action@master
with:
host: 159.89.99.23 # staging.advenjourney.com
USERNAME: ${{ secrets.STAGING_USERNAME }}
PORT: ${{ secrets.STAGING_PORT }}
KEY: ${{ secrets.STAGING_KEY }}
script: |
wget https://raw.githubusercontent.com/advenjourney/advenjourney/main/deploy/staging/docker-compose.yaml -O docker-compose.yaml
docker-compose pull
docker-compose up -d