-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (57 loc) · 1.96 KB
/
build-and-deploy.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
name: deploy-changed-apps
# on:
# workflow_dispatch
on:
push:
branches:
- master
jobs:
build_and_deploy:
runs-on: ubuntu-latest
name: Build images
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Restore cached npm dependencies
uses: actions/cache/restore@v3
with:
path: |
node_modules
~/.cache/Cypress # needed for the Cypress binary
key: npm-dependencies-${{ hashFiles('package.json') }}
- name: Install dependencies
run: pnpm install
if: steps.cache.outputs.cache-hit != 'true'
- name: Cache npm dependencies
uses: actions/cache/save@v3
with:
path: |
node_modules
~/.cache/Cypress # needed for the Cypress binary
key: npm-dependencies-${{ hashFiles('package.json') }}
- name: Build base image
run: npm run docker-base
- name: Tag base image
run:
docker tag linkerry/base registry.digitalocean.com/linkerry/base:latest
# Install doctl.
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Log in to DO Container Registry
run: doctl registry login --expiry-seconds 600
- name: Push image to DO Container Registry
run: docker push registry.digitalocean.com/linkerry/base:latest
- name: Build image for web
run: docker build -t linkerry/web -f ./apps/web/Dockerfile . --platform=linux/amd64
- name: Tag web image
run:
docker tag linkerry/web registry.digitalocean.com/linkerry/web:latest
- name: Push image to DO Container Registry
run: docker push registry.digitalocean.com/linkerry/web:latest
# - run: npx [email protected] affected -t docker-compose --base=origin/master~1 --head=origin/master