-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (48 loc) · 1.67 KB
/
build.yaml
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
name: Build - Server
on:
push:
branches:
- main
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install TypeScript compiler
run: npm i -g typescript
- name: TypeScript Build
run: |
cd pi-bank-backend
tsc --pretty > tsc-output.log 2>&1 || true
grep -v 'TS2688' tsc-output.log > filtered-tsc-output.log
cat filtered-tsc-output.log
if grep -q 'error TS' filtered-tsc-output.log; then
exit 1
fi
- name: Install Dependencies
run: |
cd ./pi-bank-backend
echo "@pi-online-bank:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${{ secrets.PASSWORD }}" > .npmrc
npm install
rm -rf .npmrc
- name: Initialize Buildx
run: |
docker buildx create --name builder || true
docker buildx use builder
- name: Build Docker Image
run: |
docker buildx build --tag pi-bank-backend -o type=image --platform=linux/arm64,linux/amd64 .
- name: Login to GitHub Container Registry
run: |
echo ${{ secrets.DOCKER_PASSWORD }} | docker login ghcr.io -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Push Docker Image to GitHub Container Registry
run: |
docker buildx build --push --tag ghcr.io/tivmof/pi-bank-backend:latest -o type=image --platform=linux/arm64,linux/amd64 .