This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
64 lines (54 loc) ยท 1.66 KB
/
build-fe-dev.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
59
60
61
62
63
64
name: CICD for Frontend Development
on:
push:
branches:
- develop
paths:
- 'frontend/**'
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'yarn'
cache-dependency-path: ${{ vars.FE_DIRECTORY }}/yarn.lock
- name: Install dependencies
run: |
yarn install --frozen-lockfile
working-directory: ${{ vars.FE_DIRECTORY }}
- name: Create .env.development variable
run: |
touch .env.development
echo "BASE_URL=${{vars.API_SERVER_URL_DEVELOPMENT}}" >> .env.development
echo "DOMAIN_URL=${{vars.WEB_URL_DEVELOPMENT}}" >> .env.development
working-directory: ${{ vars.FE_DIRECTORY }}
- name: Build
run: |
yarn build:dev
working-directory: ${{ vars.FE_DIRECTORY }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
uses: docker/build-push-action@v4
with:
context: ${{ vars.FE_DIRECTORY }}
file: ${{ vars.FE_DIRECTORY }}/Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/dong-gle-frontend-dev:latest
platforms: linux/amd64
deploy:
needs: build
uses: ./.github/workflows/deploy-dev.yml
secrets: inherit