From a58977c66130f6b61d7063859eed864bfc6ddcd0 Mon Sep 17 00:00:00 2001 From: gitea_admin_user Date: Wed, 9 Apr 2025 16:45:58 +0000 Subject: [PATCH] Add initial files --- .gitea/workflows/cd_workflows.yml | 1 + .gitea/workflows/ci_workflows.yml | 70 +++++++++++++++++++++++++++++++ README.md | 1 + 3 files changed, 72 insertions(+) create mode 100644 .gitea/workflows/cd_workflows.yml create mode 100644 .gitea/workflows/ci_workflows.yml create mode 100644 README.md diff --git a/.gitea/workflows/cd_workflows.yml b/.gitea/workflows/cd_workflows.yml new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/.gitea/workflows/cd_workflows.yml @@ -0,0 +1 @@ +{} diff --git a/.gitea/workflows/ci_workflows.yml b/.gitea/workflows/ci_workflows.yml new file mode 100644 index 0000000..4839243 --- /dev/null +++ b/.gitea/workflows/ci_workflows.yml @@ -0,0 +1,70 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - '*' + branches-ignore: + - main + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run Unit Tests + run: python -m unittest discover -s . -p 'test_*.py' + + build_and_push: + runs-on: ubuntu-latest + needs: test # Ensures `build_and_push` runs only if `test` succeeds + env: + DOCKER_HOST: unix:///var/run/docker.sock + steps: + - name: Identify Repository + id: extract_repo + run: echo "::set-output name=repo_name::${GITHUB_REPOSITORY##*/}" + + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Configure Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: docker + + - name: Auth to Container Registry + uses: docker/login-action@v2 + with: + registry: centurion-version-control.default.svc.cluster.local:3000 + username: ${{ secrets.CI_USER }} + password: ${{ secrets.CI_USER_TOKEN }} + + - name: Pull activity_block_wrapper Image + run: | + docker pull centurion-version-control.default.svc.cluster.local:3000/centurion/system/blocks-activity-wrapper:latest + + - name: Build and push Container Image + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: | + centurion-version-control.default.svc.cluster.local:3000/centurion/${{ steps.extract_repo.outputs.repo_name }}/${{ github.ref_name }}:${{ github.sha }} + centurion-version-control.default.svc.cluster.local:3000/centurion/${{ steps.extract_repo.outputs.repo_name }}/${{ github.ref_name }}:latest + build-args: | + CONTAINER_REGISTRY=centurion-version-control.default.svc.cluster.local:3000/centurion/system diff --git a/README.md b/README.md new file mode 100644 index 0000000..59a3efc --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +**Hello world!!!**