From 82a34496e79162e67a1b08555381b84fc12c2069 Mon Sep 17 00:00:00 2001 From: Athfan Khaleel Date: Wed, 4 Oct 2023 22:37:28 +0500 Subject: [PATCH] - ci/cd --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fa87e6a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: Docker Build + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Build and push Docker image + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + IMAGE_NAME: userbot + run: | + docker build -f .build/Dockerfile -t ghcr.io/$DOCKER_USERNAME/$IMAGE_NAME .. + docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD + docker push $DOCKER_USERNAME/$IMAGE_NAME