From cd7c1e029652ad21f0d1f5c37f2c7dc28cbaee03 Mon Sep 17 00:00:00 2001 From: Rodrigo Seiji Piubeli Hirao Date: Mon, 3 Feb 2025 17:51:57 -0300 Subject: [PATCH] Feat: CI --- .github/workflows/{deploy.yaml => cd.yaml} | 8 +++++- .github/workflows/ci.yaml | 31 ++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) rename .github/workflows/{deploy.yaml => cd.yaml} (93%) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/cd.yaml similarity index 93% rename from .github/workflows/deploy.yaml rename to .github/workflows/cd.yaml index 8140984..c0290aa 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/cd.yaml @@ -1,4 +1,4 @@ -name: Deploy +name: CD on: workflow_call: @@ -22,6 +22,11 @@ on: required: false default: "bud-apps" description: Project to search for file on `k8s_repository` + docker_target: + type: string + required: false + default: "run" + description: docker step to create image secrets: AWS_ACCESS_KEY_ID: required: true @@ -61,6 +66,7 @@ jobs: file: Dockerfile push: true tags: "${{ steps.login-ecr.outputs.registry }}/${{ env.REPO }}:${{ env.TAG }}" + target: "${{ inputs.docker_target }}" build-args: | GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..b04a1b4 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,31 @@ +name: CI + +on: + workflow_call: + inputs: + docker_target: + type: string + required: false + default: "test" + description: docker step to run + +env: + REPO: ${{ github.event.repository.name }} + TAG: ${{ github.sha }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Build and push image to ECR + uses: docker/build-push-action@v5 + with: + context: . + file: Dockerfile + push: false + tags: "${{ env.REPO }}:${{ env.TAG }}" + target: "${{ inputs.docker_target }}" +