generated from JDIZM/node-express-firebase-mongodb
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.55 KB
/
main.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
name: test-and-build
on:
push:
branches:
- main
jobs:
test-and-build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]
steps:
- uses: actions/checkout@v4
- uses: volta-cli/action@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm i
- run: npm run lint
- run: npm run format:check
- run: npm run tsc:check
- run: npm run build
- run: npm run test
# TODO uncomment the deployment step when you have configured the secrets.
# deploy-dev:
# needs: test-and-build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: volta-cli/action@v3
# with:
# node-version: 20
# - name: Install doctl
# uses: digitalocean/action-doctl@v2
# with:
# token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
# - name: Build container image
# run: docker build -t ${{ secrets.REGISTRY_NAME }}/${{secrets.IMAGE_NAME}}-dev:$(echo $GITHUB_SHA | head -c7) .
# - name: Log in to DigitalOcean Container Registry with short-lived credentials
# run: doctl registry login --expiry-seconds 1200
# - name: tag image with latest tag
# run: docker tag ${{ secrets.REGISTRY_NAME }}/${{secrets.IMAGE_NAME}}-dev:$(echo $GITHUB_SHA | head -c7) ${{ secrets.REGISTRY_NAME }}/${{secrets.IMAGE_NAME}}-dev:latest
# - name: Push image to DigitalOcean Container Registry
# run: docker push ${{ secrets.REGISTRY_NAME }}/${{secrets.IMAGE_NAME}}-dev:latest