-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (52 loc) · 1.87 KB
/
main.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
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
subtree:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.TOKEN }}
- run: git remote add old https://github.com/mermaid-pirates/WAIS.git
- run: git fetch --unshallow old
- run: git subtree split --prefix backend -b be
- run: git subtree split --prefix frontend -b fe
- run: git checkout be
- run: git branch -D main
- run: git branch -m main
- run: git push https://github.com/mermaid-pirates/mermaid-backend.git main --force
- run: git checkout fe
- run: git branch -D main
- run: git branch -m main
- run: git push https://github.com/mermaid-pirates/mermaid-frontend.git main --force
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}
- name: build and release to DockerHub
env:
NAME: ssggyu # 계정 명
REPO1: waisf # 프론트엔드 레포 이름
REPO2: waisb # 백엔드 레포 이름
run: |
cd frontend
docker build -t $REPO1 .
docker tag $REPO1:latest $NAME/$REPO1:latest
docker push $NAME/$REPO1:latest
cd ../backend
docker build -t $REPO2 .
docker tag $REPO2:latest $NAME/$REPO2:latest
docker push $NAME/$REPO2:latest