From f19e2a35d3fe6ffb5195bd4111f64abc288ecd21 Mon Sep 17 00:00:00 2001 From: Sameer Kumar Subudhi Date: Mon, 20 Jan 2025 14:51:52 +0100 Subject: [PATCH] Try setting CI/CD --- .github/workflows/docker.yaml | 67 +++++++++++++++++++++++++++++++++++ .github/workflows/static.yml | 37 ------------------- 2 files changed, 67 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/docker.yaml delete mode 100644 .github/workflows/static.yml diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml new file mode 100644 index 000000000..780ef8437 --- /dev/null +++ b/.github/workflows/docker.yaml @@ -0,0 +1,67 @@ +name: Build docker image + +on: + push: + branches: + # - master + - test-ci-cd + +env: + ECS_TASK_DEFINITION: task-definition.json + +jobs: + docker: + name: Build and push docker image + permissions: + id-token: write + contents: read + runs-on: ubuntu-latest + environment: ${{ github.ref_name }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + # ref: ${{ github.ref }} + submodules: recursive + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: "zulu" + java-version: 21 + + - name: Setup gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@0e613a0980cbf65ed5b322eb7a1e075d28913a83 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: eu-west-3 + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@62f4f872db3836360b72999f4b87f1ff13310f3a + + - name: Clean local Gradle repository + run: make clean + + - name: Build docker image + run: make jib + + # - name: Docker image + # id: docker-image + # run: | + # echo "image=${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_REPOSITORY }}" >> $GITHUB_OUTPUT + + # - name: Build and push the image + # uses: docker/build-push-action@v6 + # id: docker-build + # with: + # context: . + # push: true + # tags: | + # ${{ steps.docker-image.outputs.image }}:latest + # ${{ steps.docker-image.outputs.image }}:${{ github.sha }} diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml deleted file mode 100644 index 95052fb22..000000000 --- a/.github/workflows/static.yml +++ /dev/null @@ -1,37 +0,0 @@ -# Simple workflow for deploying static content to GitHub Pages -name: Deploy static content to Pages - -on: - # Runs on pushes targeting the default branch - push: - paths: - - '**/docs/**' - branches: ["master"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - # Single deploy job since we're just deploying - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: asciidoctor-ghpages - uses: manoelcampos/asciidoctor-ghpages-action@v2 - env: - PREFIX: ${{ github.server_url }}/${{ github.repository }}/tree/master/docs/ - with: - pre_build: find ./docs -name '*.adoc' -print0 | xargs -0 sed -i -e "s|link:\([^ ]*\)|link:${PREFIX}\1|g" -