generated from JDIZM/node-express-firebase-mongodb
-
Notifications
You must be signed in to change notification settings - Fork 3
69 lines (59 loc) · 2.04 KB
/
main.yml
File metadata and controls
69 lines (59 loc) · 2.04 KB
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
name: test-and-build
on:
push:
branches:
- main
jobs:
test-and-build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22, 24]
steps:
- uses: actions/checkout@v4
- uses: volta-cli/action@v4
with:
node-version: ${{ matrix.node-version }}
- run: volta install pnpm
- run: pnpm install
- run: pnpm run lint
- run: pnpm run format:check
- run: pnpm run tsc:check
- run: pnpm run build
- run: pnpm run test
# Run database migrations for development environment
migrate-dev:
needs: test-and-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: volta-cli/action@v4
with:
node-version: 22
- run: volta install pnpm
- run: pnpm install
- name: Run database migrations
env:
DATABASE_URL: ${{ secrets.DEV_DATABASE_URL }}
run: pnpm migrate
# TODO uncomment the deployment step when you have configured the secrets.
# deploy-dev:
# needs: [test-and-build, migrate-dev]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: volta-cli/action@v4
# with:
# node-version: 22
# - 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