From b4b930e658ae670f8ad732426c90a2d0d7fa423e Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Thu, 26 Oct 2023 00:06:14 +0200 Subject: [PATCH] ci: Adds docker build & push --- .github/workflows/push.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/push.yml diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000..8a8d706 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,28 @@ +name: push +on: + push: + branches: main + +jobs: + dockerhub: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v4 + with: + python-version: 3.9 + architecture: x64 + - uses: abatilo/actions-poetry@v2 + with: + poetry-version: "1.6.1" + - name: Resolve dependencies + run: poetry export -f requirements.txt --without-hashes --output requirements.txt + - name: Build docker + run: docker build src/. -t quackai/contribution-api:latest + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: quackai + password: ${{ secrets.DOCKERHUB_PW }} + - name: Push to hub + run: docker push quackai/contribution-api:latest