diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..ab03aa9 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,32 @@ +name: Deploy to docker hub + +on: + push: + branches: + - master + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - name: Login to docker hub + if: success() + uses: actions-hub/docker/login@master + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build image + if: success() + run: docker build -t ${GITHUB_REPOSITORY}:${IMAGE_TAG} . + + - name: Push to docker registry + if: success() + uses: actions-hub/docker@master + with: + args: push ${GITHUB_REPOSITORY}:${IMAGE_TAG}