From 2b0cf6412fdb0f931e82715506cdc3de9c07c90e Mon Sep 17 00:00:00 2001 From: RyushiAok <55625375+RyushiAok@users.noreply.github.com> Date: Fri, 3 Nov 2023 01:07:44 +0900 Subject: [PATCH] cd: docker build --- .github/workflows/docker-build.yaml | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/docker-build.yaml diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml new file mode 100644 index 0000000..6cb1319 --- /dev/null +++ b/.github/workflows/docker-build.yaml @@ -0,0 +1,38 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - main + - cd/** + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + environment: + name: production + url: https://google.com + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Google Artifact Registry + uses: docker/login-action@v1 + with: + registry: asia-northeast1-docker.pkg.dev + username: _json_key + password: ${{ secrets.GCP_SA_KEY }} + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: ./server/src + push: true + tags: ${{ secrets.DOCKER_IMAGE_NAME }}:latest