diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml new file mode 100644 index 0000000..2d3f614 --- /dev/null +++ b/.github/workflows/build-and-publish.yml @@ -0,0 +1,30 @@ +name: Build and Publish + +on: + workflow_dispatch: + +jobs: + # define job to build and publish docker image + build-and-push-docker-image: + name: Build Docker image and push to repositories + runs-on: ubuntu-latest + + # steps to perform in job + steps: + - name: Checkout code + uses: actions/checkout@v3.1.0 + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build image and push to Docker Hub + uses: docker/build-push-action@v2 + with: + # relative path to the place where source code with Dockerfile is located + context: . + tags: | + sorokinmx/android-store:latest, sorokinmx/android-store:${{ github.run_number }} + push: true