From 7e6ed0bcd4e53f7c8165cbf370dbe2e210230038 Mon Sep 17 00:00:00 2001 From: wxh Date: Mon, 24 Oct 2022 01:30:48 +0000 Subject: [PATCH] ci: add ci.yml --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ Dockerfile | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) 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..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