From 05fed55927f719c5221de6f089f996f7cd22f03a Mon Sep 17 00:00:00 2001 From: Joshua Hegedus Date: Wed, 27 Mar 2024 17:47:58 +0100 Subject: [PATCH] added ci --- .github/workflows/build-and-push.yml | 77 ++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/build-and-push.yml diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml new file mode 100644 index 0000000..72837ff --- /dev/null +++ b/.github/workflows/build-and-push.yml @@ -0,0 +1,77 @@ +name: Docker Image CI + +on: + release: ["publish"] + +jobs: + build-handler: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to GitHub container registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.DOCKER_PUSH }} + + - name: Lowercase the repo name + run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} + - name: Prepare and build the container hashed image + run: ./scripts/builder.sh handler ghcr.io/${{ env.REPO }}-handler:${{ github.sha }} + - name: Prepare and build the container latest image + run: ./scripts/builder.sh handler ghcr.io/${{ env.REPO }}-handler:latest + + build-reciever: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to GitHub container registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.DOCKER_PUSH }} + + - name: Lowercase the repo name + run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} + - name: Prepare and build the container hashed image + run: ./scripts/builder.sh reciever ghcr.io/${{ env.REPO }}-reciever:${{ github.sha }} + - name: Prepare and build the container latest image + run: ./scripts/builder.sh reciever ghcr.io/${{ env.REPO }}-reciever:latest + + build-checker: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to GitHub container registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.DOCKER_PUSH }} + + - name: Lowercase the repo name + run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} + - name: Prepare and build the container hashed image + run: ./scripts/builder.sh checker ghcr.io/${{ env.REPO }}-checker:${{ github.sha }} + - name: Prepare and build the container latest image + run: ./scripts/builder.sh checker ghcr.io/${{ env.REPO }}-checker:latest + deploy-stack: + runs-on: ubuntu-latest + needs: [build-website, build-handler, build-checker, build-reciever] + steps: + - name: Invoke deployment hook + run: curl -X POST ${{ secrets.WEBHOOK_URL }}