-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (31 loc) · 979 Bytes
/
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
name: Build and Deploy
on:
push:
branches: ["main"]
env:
S3_ENDPOINT: "minio.beta.andy-cinquin.fr"
S3_SSL: true
S3_PORT: 9000
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Yarn install and build
run: |
yarn install
yarn build
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ secrets.APP_IMAGE }}
- name: Deploy on cap rover
run: docker run caprover/cli-caprover:latest caprover deploy --caproverUrl "${{ secrets.APP_URL }}" --appToken "${{ secrets.APP_TOKEN }}" --caproverApp "${{ secrets.APP_NAME }}" --imageName "${{ secrets.APP_IMAGE }}"