diff --git a/.github/workflows/continious_integration.yml b/.github/workflows/continious_integration.yml new file mode 100644 index 0000000..d1de54e --- /dev/null +++ b/.github/workflows/continious_integration.yml @@ -0,0 +1,81 @@ +name: Build and Deploy EDC to Cluster +on: +# pull_request: +# types: +# - opened +# - reopened +# - review_requested + push: + branches: ["develop"] + workflow_dispatch: +env: + REGISTRY: ghcr.io + NAMESPACE: possible-x +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'temurin' + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + buildkitd-flags: --debug + + - name: Prepare required files + env: + USERNAME_GITHUB: ${{ github.actor }} + TOKEN_GITHUB: ${{ secrets.GITHUB_TOKEN }} + run: sh ./gradlew clean build + + - name: Docker "connector" meta + id: connector-meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/connector + tags: | + type=raw,value=latest,enable={{is_default_branch}} + ${{ github.sha }} + - name: Build and push "connector" + id: build_and_push_connector + uses: docker/build-push-action@v4 + with: + context: ./connector + file: ./connector/Dockerfile + push: false + tags: ${{ steps.connector-meta.outputs.tags }} + labels: ${{ steps.connector-meta.outputs.labels }} +# deployment: +# runs-on: 'ubuntu-latest' +# needs: build-and-push-image +# steps: +# - name: 'Invoke Kubectl Provider' +# uses: actions-hub/kubectl@master +# env: +# KUBE_CONFIG: ${{ secrets.KUBECONFIG }} +# with: +# args: "set image deployment/${{vars.PROVIDER_DEPLOYMENT_NAME}} -n ${{ vars.PROVIDER_NS }} possible-x-edc=${{ env.REGISTRY }}/possible-x/connector:${{ github.sha }} " +# +# - name: 'Invoke Kubectl Consumer' +# uses: actions-hub/kubectl@master +# env: +# KUBE_CONFIG: ${{ secrets.KUBECONFIG }} +# with: +# args: "set image deployment/${{vars.CONSUMER_DEPLOYMENT_NAME}} -n ${{ vars.CONSUMER_NS }} possible-x-edc=${{ env.REGISTRY }}/possible-x/connector:${{ github.sha }} "