From f7742c8aee51a8c895487802efad5c427d6b8c44 Mon Sep 17 00:00:00 2001 From: omaroughriss Date: Thu, 3 Jul 2025 12:19:38 +0200 Subject: [PATCH] Add CICD --- .github/workflows/cicd.yml | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/cicd.yml diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml new file mode 100644 index 0000000..900c819 --- /dev/null +++ b/.github/workflows/cicd.yml @@ -0,0 +1,43 @@ +name: Build and Push to Registry + +on: + push: + branches: [ cicd ] + +env: + REGISTRY: git.4nkweb.com + IMAGE_NAME: 4nk/sdk_relay + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up SSH agent + uses: webfactory/ssh-agent@v0.9.1 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ secrets.USER }} + password: ${{ secrets.TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + ssh: default + build-args: | + ENV_VARS=${{ secrets.ENV_VARS }} + tags: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ gitea.sha }} \ No newline at end of file