diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml new file mode 100644 index 0000000..cf048dc --- /dev/null +++ b/.github/workflows/build-docker.yml @@ -0,0 +1,34 @@ +name: opentrashmail ci + +# use either +# ${{steps.date.outputs.date}} for date tag +# or ${{ github.event.release.tag_name }} for github release + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +%s)" + - uses: actions/checkout@v2 + - name: Build the Docker image + run: docker build . --file docker/Dockerfile --tag hascheksolutions/opentrashmail:${{ github.event.release.tag_name }} --tag hascheksolutions/opentrashmail:latest + - + name: Login to registry + uses: docker/login-action@v1 + with: + registry: registry.haschek.at + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Pushing push as latest + run: docker push hascheksolutions/opentrashmail:latest + - name: Pushing to private registry + run: docker push hascheksolutions/opentrashmail:${{ github.event.release.tag_name }} \ No newline at end of file