diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cc1ea8b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: ci + +on: + workflow_dispatch: + push: + branches: + - 'master' + tags: + - 'v*' + pull_request: + branches: + - 'master' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - + name: Build and push + if: ${{ github.event_name != 'pull_request' }} + run: | + docker buildx build --platform=linux/amd64 -t ${{ secrets.DOCKERHUB_USERNAME }}/aquery:${{github.sha}} . + docker push ${{ secrets.DOCKERHUB_USERNAME }}/aquery:${{github.sha}} + docker tag ${{ secrets.DOCKERHUB_USERNAME }}/aquery:${{github.sha}} ${{ secrets.DOCKERHUB_USERNAME }}/aquery:latest + docker push ${{ secrets.DOCKERHUB_USERNAME }}/aquery:latest diff --git a/Dockerfile b/Dockerfile index aac0a4f..953d89f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:latest -RUN cp /bin/bash /bin/sh +# RUN cp /bin/bash /bin/sh RUN apt update && apt install -y wget