From debeeabdcc17825ff6150684c865fecf8b105b98 Mon Sep 17 00:00:00 2001 From: seungheon123 Date: Sat, 9 Nov 2024 15:53:28 +0900 Subject: [PATCH] =?UTF-8?q?:globe=5Fwith=5Fmeridians:=20[Ci]=20action=20sc?= =?UTF-8?q?ript=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/api-deploy.yml | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/api-deploy.yml diff --git a/.github/workflows/api-deploy.yml b/.github/workflows/api-deploy.yml new file mode 100644 index 00000000..38ce1a43 --- /dev/null +++ b/.github/workflows/api-deploy.yml @@ -0,0 +1,37 @@ +name: API Server Ci/Cd +on: + push: + branches: + - Ci/69 + - develop + paths: +# - 'apps/api/**' +jobs: + build-and-push: + runs-on: ubuntu-latest + + env: + IMAGE_NAME: api-camon + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Log in to Ncloud Container Registry + env: + USERNAME: ${{ secrets.NCLOUD_ACCESS_KEY }} + PASSWORD: ${{ secrets.NCLOUD_SECRET_KEY }} + REGISTRY_URL: ${{ secrets.NCLOUD_REGISTRY_URL }} + run: | + echo "$PASSWORD" | docker login -u "$USERNAME" "$REGISTRY_URL" --password-stdin + + - name: Build Docker image + run: | + docker build -t ${{ secrets.NCLOUD_REGISTRY_URL }}/$IMAGE_NAME:latest ./apps/api + + - name: Push to Ncloud Container Registry + run: | + docker push ${{ secrets.NCLOUD_REGISTRY_ID }}/$IMAGE_NAME:latest + + +