-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (47 loc) · 1.68 KB
/
ci-cd.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
name: CI/CD Workflow
on:
pull_request:
branches:
- "**"
push:
branches:
- dev
- main
jobs:
linting-and-formatting:
name: Perform linting and formatting checks
runs-on: ubuntu-latest
steps:
- name: Checkout the Repository
uses: actions/checkout@v3
- name: Install Dependencies
run: npm install
- name: Run linting check
run: npm run lint:check
- name: Check formatting
run: npm run format:check
build-and-deploy:
name: Build and Deploy Application
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.REPO_TOKEN }}
- name: Build and Push app.prod Image
run: |
REPO_OWNER_LOWER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
REPO_NAME_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
docker build -f Dockerfile.app.prod -t ghcr.io/$REPO_NAME_LOWER/app-prod:latest .
docker push ghcr.io/$REPO_NAME_LOWER/app-prod:latest
- name: Build and Push hls_proxy Image
run: |
REPO_OWNER_LOWER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
REPO_NAME_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
docker build -f Dockerfile.hls_proxy -t ghcr.io/$REPO_NAME_LOWER/hls-proxy:latest .
docker push ghcr.io/$REPO_NAME_LOWER/hls-proxy:latest