diff --git a/.github/workflows/build-be-dev.yml b/.github/workflows/build-be-dev.yml deleted file mode 100644 index c9392723..00000000 --- a/.github/workflows/build-be-dev.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: CICD for Backend Development - -on: - push: - branches: - - develop - paths: - - "backend/**" - workflow_dispatch: - -permissions: - contents: read - -jobs: - build: - runs-on: ubuntu-latest - steps: - ## jdk setting - - uses: actions/checkout@v3 - with: - submodules: true - token: ${{ secrets.SUBMODULE_TOKEN }} - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: "17" - distribution: "temurin" # https://github.com/actions/setup-java - cache: gradle - - ## gradle caching - - name: Gradle Caching - uses: actions/cache@v3 - with: - path: | - .gradle/caches - .gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}- - - ## gradle build - - name: Test with Gradle - run: | - cd ./backend - ./gradlew test - - - name: Build with Gradle - run: | - cd ./backend - ./gradlew build -x test - - - 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: ./backend - file: ./backend/Dockerfile-dev - push: true - tags: ${{ secrets.DOCKER_USERNAME }}/dong-gle-backend-dev:latest - platforms: linux/amd64 - - deploy: - needs: build - uses: ./.github/workflows/deploy-dev.yml - secrets: inherit diff --git a/.github/workflows/build-be-prod.yml b/.github/workflows/build-be-prod.yml deleted file mode 100644 index 3810d464..00000000 --- a/.github/workflows/build-be-prod.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: CICD for Backend Production - -on: - workflow_call: - workflow_dispatch: - -permissions: - contents: read - -jobs: - build: - runs-on: ubuntu-latest - steps: - ## jdk setting - - uses: actions/checkout@v3 - with: - submodules: true - token: ${{ secrets.SUBMODULE_TOKEN }} - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: "17" - distribution: "temurin" # https://github.com/actions/setup-java - cache: gradle - - ## gradle caching - - name: Gradle Caching - uses: actions/cache@v3 - with: - path: | - .gradle/caches - .gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}- - - ## gradle build - - name: Test with Gradle - run: | - cd ./backend - ./gradlew test - - - name: Build with Gradle - run: | - cd ./backend - ./gradlew build -x test - - - 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: ./backend - file: ./backend/Dockerfile-prod - push: true - tags: ${{ secrets.DOCKER_USERNAME }}/dong-gle-backend-prod:latest - platforms: linux/amd64 diff --git a/.github/workflows/build-fe-dev.yml b/.github/workflows/build-fe-dev.yml deleted file mode 100644 index ccceac74..00000000 --- a/.github/workflows/build-fe-dev.yml +++ /dev/null @@ -1,64 +0,0 @@ -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 diff --git a/.github/workflows/build-fe-prod.yml b/.github/workflows/build-fe-prod.yml deleted file mode 100644 index dea2a121..00000000 --- a/.github/workflows/build-fe-prod.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: CICD for Frontend Production - -on: - workflow_call: - 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.production variable - run: | - touch .env.production - echo "BASE_URL=${{vars.API_SERVER_URL_PRODUCTION}}" >> .env.production - echo "DOMAIN_URL=${{vars.WEB_URL_PRODUCTION}}" >> .env.production - working-directory: ${{ vars.FE_DIRECTORY }} - - - name: Build - run: | - yarn build:prod - 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-prod:latest - platforms: linux/amd64 diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml deleted file mode 100644 index 3cc75b8a..00000000 --- a/.github/workflows/deploy-dev.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Run Docker Compose - -on: - workflow_call: - workflow_dispatch: - -permissions: - contents: read - -jobs: - deploy: - runs-on: [self-hosted, donggle-dev] - steps: - - uses: actions/checkout@v3 - - name: create .env - run: | - touch .env - echo "DOCKER_USERNAME=${{ secrets.DOCKER_USERNAME }}" >> .env - echo "SPRING_PROFILES_ACTIVE=${{ vars.SPRING_PROFILES_ACTIVE_DEVELOPMENT }}" >> .env - echo "INFRA_PROFILE=${{ vars.INFRA_PROFILE_DEVELOPMENT }}" >> .env - ## deploy to production - - name: Deploy to prod - run: | - sudo docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - sudo chmod +x deploy.sh - sudo ./deploy.sh ${{ vars.INFRA_PROFILE_DEVELOPMENT }} - sudo docker image prune -af diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml deleted file mode 100644 index a08fce59..00000000 --- a/.github/workflows/deploy-prod.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Run Docker Compose Production - -on: - workflow_dispatch: - -permissions: - contents: read - -jobs: - fe-build: - uses: ./.github/workflows/build-fe-prod.yml - secrets: inherit - - be-build: - uses: ./.github/workflows/build-be-prod.yml - secrets: inherit - - deploy: - runs-on: [self-hosted, donggle-prod] - needs: [fe-build, be-build] - steps: - - uses: actions/checkout@v3 - - name: create .env - run: | - touch .env - echo "DOCKER_USERNAME=${{ secrets.DOCKER_USERNAME }}" >> .env - echo "SPRING_PROFILES_ACTIVE=${{ vars.SPRING_PROFILES_ACTIVE_PRODUCTION }}" >> .env - echo "INFRA_PROFILE=${{ vars.INFRA_PROFILE_PRODUCTION}}" >> .env - ## deploy to production - - name: Deploy to prod - run: | - sudo docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - sudo chmod +x ./deploy.sh - sudo ./deploy.sh ${{ vars.INFRA_PROFILE_PRODUCTION }} - sudo docker image prune -af diff --git a/.github/workflows/fe-test-e2e.yml b/.github/workflows/fe-test-e2e.yml deleted file mode 100644 index 99069fbb..00000000 --- a/.github/workflows/fe-test-e2e.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Cypress Tests - -on: - pull_request: - branches: - - develop - paths: - - frontend/** - - .github/** - -defaults: - run: - working-directory: ./frontend - -jobs: - cypress-run: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Create .env.development file - run: | - touch .env.development - echo "BASE_URL=${{vars.API_SERVER_URL_DEVELOPMENT}}" >> .env.development - echo "DOMAIN_URL=${{vars.WEB_URL_DEVELOPMENT}}" >> .env.development - - - name: Cypress run - uses: cypress-io/github-action@v5 - with: - start: yarn start:mocking - wait-on: "http://localhost:3000" - browser: chrome - working-directory: ./frontend - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}