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:${{ steps.date.outputs.date }} --tag hascheksolutions/opentrashmail:latest - name: Login to registry uses: docker/login-action@v1 with: 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:${{ steps.date.outputs.date }}