From 31d62dda97c1cc08a50115d9d844cad0645173d4 Mon Sep 17 00:00:00 2001 From: Luke Else Date: Wed, 18 Jun 2025 19:20:18 +0100 Subject: [PATCH] FEAT: Added pipeline framework --- .gitea/workflows/dev.yaml | 30 ++++++++++++++++++++++++++++++ .gitea/workflows/main.yaml | 30 ++++++++++++++++++++++++++++++ .gitea/workflows/test.yaml | 25 +++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 .gitea/workflows/dev.yaml create mode 100644 .gitea/workflows/main.yaml create mode 100644 .gitea/workflows/test.yaml diff --git a/.gitea/workflows/dev.yaml b/.gitea/workflows/dev.yaml new file mode 100644 index 0000000..053cb31 --- /dev/null +++ b/.gitea/workflows/dev.yaml @@ -0,0 +1,30 @@ +name: Build and Push Development Docker Image + +on: + push: + branches: [ development ] + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + registry: ${{ secrets.CONTAINER_REGISTRY }} + username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }} + password: ${{ secrets.CONTAINER_REGISTRY_PASSKEY }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and Tag Docker Image + run: | + docker build -t ${{ secrets.CONTAINER_REGISTRY }}/${{ secrets.CONTAINER_REGISTRY_USERNAME }}/METARIUS:dev . + + - name: Push Docker Image + run: | + docker push ${{ secrets.CONTAINER_REGISTRY }}/${{ secrets.CONTAINER_REGISTRY_USERNAME }}/METARIUS:dev diff --git a/.gitea/workflows/main.yaml b/.gitea/workflows/main.yaml new file mode 100644 index 0000000..ab0fd13 --- /dev/null +++ b/.gitea/workflows/main.yaml @@ -0,0 +1,30 @@ +name: Build and Push Latest Docker Image + +on: + push: + branches: [ main ] + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + registry: ${{ secrets.CONTAINER_REGISTRY }} + username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }} + password: ${{ secrets.CONTAINER_REGISTRY_PASSKEY }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and Tag Docker Image + run: | + docker build -t ${{ secrets.CONTAINER_REGISTRY }}/${{ secrets.CONTAINER_REGISTRY_USERNAME }}/METARIUS:latest . + + - name: Push Docker Image + run: | + docker push ${{ secrets.CONTAINER_REGISTRY }}/${{ secrets.CONTAINER_REGISTRY_USERNAME }}/METARIUS:latest diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml new file mode 100644 index 0000000..c075568 --- /dev/null +++ b/.gitea/workflows/test.yaml @@ -0,0 +1,25 @@ +name: Run Unit and Integration Tests + +on: + push: + branches: + - '**' + pull_request: + branches: + - "main" + - "development" +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + + - name: Install Dependencies + run: npm install + + - name: Run Tests + run: npm test \ No newline at end of file