-
Notifications
You must be signed in to change notification settings - Fork 1.1k
83 lines (73 loc) · 2.6 KB
/
push.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
76
77
78
79
80
81
82
83
name: Push
on: [push, workflow_dispatch]
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
lint-and-test:
name: Lint & Test
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- uses: actions/setup-node@v4
with:
node-version: 14
- name: Testing
run: |
npm install
npm run lint
npm run test
- name: Uploading test coverage
uses: codecov/codecov-action@v3
docker-images:
name: Build/Push development docker image
if:
github.repository == 'chrisleekr/binance-trading-bot' && github.ref ==
'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
# https://github.com/docker/setup-qemu-action#usage
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
# https://github.com/marketplace/actions/docker-setup-buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# https://github.com/docker/login-action#docker-hub
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get build args
run: |
echo "PACKAGE_VERSION=$(grep -m1 version package.json | cut -c 15- | rev | cut -c 3- | rev)" >> $GITHUB_ENV
echo "GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
# https://github.com/docker/build-push-action#multi-platform-image
- name: Build/Push development docker image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
target: production-stage
build-args: |
PACKAGE_VERSION=${{ env.PACKAGE_VERSION }}
GIT_HASH=${{ env.GIT_HASH }}
NODE_ENV=production
tags: |
chrisleekr/binance-trading-bot:development
# https://github.com/docker/build-push-action#multi-platform-image
- name: Build/Push development docker image - tradingview
uses: docker/build-push-action@v2
with:
context: ./tradingview
file: ./tradingview/Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: |
chrisleekr/binance-trading-bot:tradingview-development